Open
Description
func (s *ScrapeMate) waitForSignal(sigChan <-chan os.Signal) {
go func() {
select {
case <-sigChan:
s.log.Info("received signal, shutting down")
s.cancelFn(ErrorExitSignal)
case <-s.Done(): // Listen to the context's Done channel
s.log.Info("context cancelled, exiting signal handler")
return // Exit the goroutine
}
}()
}
Metadata
Metadata
Assignees
Labels
No labels