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

Add context deadline for pending queue's receive block #13114

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

terencechain
Copy link
Member

Add context deadline for pending queue's receive block function. It's currently set to two slots

@terencechain terencechain added the Ready For Review A pull request ready for code review label Oct 25, 2023
@terencechain terencechain self-assigned this Oct 25, 2023
@terencechain terencechain requested a review from a team as a code owner October 25, 2023 01:19
@terencechain terencechain changed the title Add context dead like for pending queue's receive block Add context deadline for pending queue's receive block Oct 25, 2023
Comment on lines 211 to 212
deadlineTime := time.Now().Add(twoSlotDuration)
contextWithDeadline, cancelFunction := context.WithDeadline(ctx, deadlineTime)
Copy link
Contributor

Choose a reason for hiding this comment

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

It is slightly less verbose to use a WithTimeout context

contextWithTimeout, cancelFunction := context.WithTimeout(ctx, twoSlotDuration)

@prylabs-bulldozer prylabs-bulldozer bot merged commit cabf347 into develop Oct 25, 2023
5 checks passed
@prylabs-bulldozer prylabs-bulldozer bot deleted the add-ctx-deadline branch October 25, 2023 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants