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

Reset the delay of the queue in case an item that expires sooner than… #863

Merged
merged 1 commit into from Jan 24, 2019
Merged

Reset the delay of the queue in case an item that expires sooner than… #863

merged 1 commit into from Jan 24, 2019

Conversation

zaharidichev
Copy link
Contributor

Motivation

This should fix #854

Solution

The solution is to simply check whether the expiration of the item to be inserted is sooner than the one which has been polled last. In that case we simply clear the delay

carllerche
carllerche previously approved these changes Jan 24, 2019
} else { false };

if should_clear_delay {
self.delay = None;
Copy link
Member

Choose a reason for hiding this comment

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

Instead of clearing it, should the delay be reset to when?

@carllerche carllerche dismissed their stale review January 24, 2019 19:29

Clicked the wrong buttons

Copy link
Member

@carllerche carllerche left a comment

Choose a reason for hiding this comment

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

I left a comment inline (but also clicked the wrong review button)

Instead of clearing the delay, should the delay be reset to when?

@carllerche carllerche merged commit 12546d1 into tokio-rs:master Jan 24, 2019
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.

DelayQueue fails to account for delayed second insert expiring sooner than first
2 participants