Add Worker Cleanup
This commit is contained in:
parent
5dbd15c71c
commit
4194ab5944
2 changed files with 27 additions and 0 deletions
|
@ -40,6 +40,9 @@ func Start(_conf config.Config) {
|
|||
serverClose <- true
|
||||
}()
|
||||
|
||||
stopCleanup := make(chan bool, 1)
|
||||
go cleanupDeadWorkers(stopCleanup)
|
||||
|
||||
sigs := make(chan os.Signal, 1)
|
||||
signal.Notify(sigs, os.Interrupt)
|
||||
select {
|
||||
|
@ -50,6 +53,7 @@ func Start(_conf config.Config) {
|
|||
stopCtx, cancel := context.WithTimeout(context.Background(), time.Second*10)
|
||||
server.Shutdown(stopCtx)
|
||||
cancel()
|
||||
stopCleanup <- true
|
||||
slog.Info("Done")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue