Stresser: cleanly sign off when shutting down

This commit is contained in:
Sybren A. Stüvel 2022-07-15 14:07:24 +02:00
parent 1055aabee2
commit 809036898b

@ -55,6 +55,13 @@ func main() {
client := stresser.GetFlamencoClient(mainCtx, config)
stresser.Run(mainCtx, client)
log.Info().Msg("signing off at Manager")
shutdownCtx, shutdownCtxCancel := context.WithTimeout(context.Background(), 1*time.Second)
defer shutdownCtxCancel()
if _, err := client.SignOffWithResponse(shutdownCtx); err != nil {
log.Warn().Err(err).Msg("error signing off at Manager")
}
log.Info().Msg("stresser shutting down")
}