worker: silence linter

This commit is contained in:
Lukas Zapletal 2025-07-08 16:07:48 +02:00 committed by Lukáš Zapletal
parent b932daaa76
commit 26ab15b1c9

View file

@ -138,8 +138,10 @@ const maxHeartbeatRetries = 2
// With default durations it goes through all running jobs every 30 seconds and fails any unresponsive // With default durations it goes through all running jobs every 30 seconds and fails any unresponsive
// ones. Unresponsive jobs haven't checked whether or not they're cancelled in the past 2 minutes. // ones. Unresponsive jobs haven't checked whether or not they're cancelled in the past 2 minutes.
func (s *Server) WatchHeartbeats() { func (s *Server) WatchHeartbeats() {
//nolint:staticcheck // avoid SA1015, this is an endless function ticker := time.NewTicker(s.config.JobWatchFreq)
for range time.Tick(s.config.JobWatchFreq) { defer ticker.Stop()
for range ticker.C {
for _, token := range s.jobs.Heartbeats(s.config.JobTimeout) { for _, token := range s.jobs.Heartbeats(s.config.JobTimeout) {
id, _ := s.jobs.IdFromToken(token) id, _ := s.jobs.IdFromToken(token)
logrus.Infof("Removing unresponsive job: %s\n", id) logrus.Infof("Removing unresponsive job: %s\n", id)