-
Notifications
You must be signed in to change notification settings - Fork 410
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
fix(worker): consider block timeouts less than 50ms #2455
Conversation
if (member) { | ||
return parseInt(score); | ||
} | ||
blockTimeout = this.blockingConnection.capabilities.canDoubleTimeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually we must have a blockTimeout that is a positive integer. The reason being that a value of 0 represents infinity, and a negative number would yield an exception. So maybe 1ms would do it? i.e. replace 0.05 by 0.001
const blockDelay = blockUntil - Date.now(); | ||
// when we reach the time to get new jobs | ||
if (blockDelay < 1) { | ||
return 0.001; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like it will be only needed when blockDelay is less than 1 when getting a marker from a delayed job, wdyt @manast
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, lets try this approach.
ref #2450