This commit is contained in:
parent
cd3c06d7d0
commit
e47a254cad
8 changed files with 178 additions and 55 deletions
|
@ -126,8 +126,11 @@ func Start(_conf config.Config, tmplFS embed.FS, staticFS embed.FS, migrationsFS
|
|||
serverClose <- true
|
||||
}()
|
||||
|
||||
stopCleanup := make(chan bool, 1)
|
||||
go manageWorkers(stopCleanup)
|
||||
stopWorkerManagement := make(chan bool, 1)
|
||||
go manageWorkers(stopWorkerManagement)
|
||||
|
||||
stopScanning := make(chan bool, 1)
|
||||
go manageScan(stopScanning)
|
||||
|
||||
sigs := make(chan os.Signal, 1)
|
||||
signal.Notify(sigs, os.Interrupt)
|
||||
|
@ -139,7 +142,10 @@ func Start(_conf config.Config, tmplFS embed.FS, staticFS embed.FS, migrationsFS
|
|||
stopCtx, cancel := context.WithTimeout(context.Background(), time.Second*10)
|
||||
server.Shutdown(stopCtx)
|
||||
cancel()
|
||||
stopCleanup <- true
|
||||
slog.Info("Stopping Worker Management...")
|
||||
stopWorkerManagement <- true
|
||||
slog.Info("Stopping Scanning...")
|
||||
stopScanning <- true
|
||||
slog.Info("Done")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue