Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ShutdownDelay configuration #585

Merged
merged 1 commit into from
Jan 3, 2024
Merged

feat: add ShutdownDelay configuration #585

merged 1 commit into from
Jan 3, 2024

Conversation

quoral
Copy link
Contributor

@quoral quoral commented Jan 3, 2024

This adds an artifical shutdown delay, in order to allow a service to
stop receiving requests before it cancells its root context. This is
completely opt-in, and the added context cancellation delay will not be
added if no duration is configured.

This adds an artifical shutdown delay, in order to allow a service to
stop receiving requests before it cancells its root context. This is
completely opt-in, and the added context cancellation delay will not be
added if no duration is configured.
@quoral quoral requested a review from a team as a code owner January 3, 2024 10:47
go func() {
<-sigCtx.Done()
logger.Info("delaying shutdown", zap.Duration("duration", run.config.ShutdownDelay))
time.Sleep(run.config.ShutdownDelay)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👸 💤

Copy link
Member

@odsod odsod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enterprise-grade 🤌

@quoral quoral merged commit da65246 into master Jan 3, 2024
1 check passed
@quoral quoral deleted the artifical-slowdown branch January 3, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants