diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2025-02-22 14:23:28 -0500 |
---|---|---|
committer | Benjamin Chausse <benjamin@chausse.xyz> | 2025-02-22 14:23:28 -0500 |
commit | 80ea0bf9e3f481b8ea813aefaa4de3b803b9f4ba (patch) | |
tree | 1e85b8536aa90746a0b97dc9467918ef135ccbb2 /internal/app | |
parent | 4221780ce53ff7484f6f1958173373dc963e7967 (diff) |
Diffstat (limited to 'internal/app')
-rw-r--r-- | internal/app/action.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/internal/app/action.go b/internal/app/action.go index 78bb251..59d0f9a 100644 --- a/internal/app/action.go +++ b/internal/app/action.go @@ -54,11 +54,9 @@ func action(ctx context.Context, cmd *cli.Command) error { } brutalShutdown = func() { - once.Do(func() { // Ensure graceful shutdown isn't re-executed - slog.WarnContext(ctx, "Graceful shutdown delay exceeded, shutting down NOW!") - server.Stop() - store.Close() - }) + slog.WarnContext(ctx, "Graceful shutdown delay exceeded, shutting down NOW!") + server.Stop() + store.Close() } port := fmt.Sprintf(":%d", cmd.Int(FlagListenPort)) @@ -90,9 +88,9 @@ func action(ctx context.Context, cmd *cli.Command) error { go gracefulShutdown() select { - case <-shutdownDone: // If graceful shutdown completes in time, exit normally case <-time.After(cmd.Duration(FlagGraceTimeout)): // Timeout exceeded brutalShutdown() + case <-shutdownDone: // If graceful shutdown completes in time, exit normally } running = false } |