From 809036898bc84c079abad1642d1d19ff37874e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 15 Jul 2022 14:07:24 +0200 Subject: [PATCH] Stresser: cleanly sign off when shutting down --- cmd/stresser/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/stresser/main.go b/cmd/stresser/main.go index 214d74ca..6efbf4c0 100644 --- a/cmd/stresser/main.go +++ b/cmd/stresser/main.go @@ -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") }