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

fix: call Queue.isReady() before job promote is called #1619

Merged
merged 1 commit into from
Mar 1, 2020

Conversation

chocof
Copy link

@chocof chocof commented Jan 19, 2020

The issue is described here: #1231

@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.764% when pulling 4b3abca on chocof:uninitialized_queue_promote_fix into 081b37f on OptimalBits:develop.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.764% when pulling 4b3abca on chocof:uninitialized_queue_promote_fix into 081b37f on OptimalBits:develop.

@gohiei
Copy link

gohiei commented Feb 26, 2020

I test it at my local machine, and it works well.

}
});
return queue.isReady().then(() =>
scripts.promote(queue, jobId).then(result => {
Copy link
Member

Choose a reason for hiding this comment

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

a return is needed here so that the promise returned by promote is propagated correctly.

Copy link
Author

Choose a reason for hiding this comment

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

Hello @manast , do you mean the following part of the code
... .then(() => scripts.promote() ...)
if yes then in es6 the syntax () => value is identical to () => { return value } so it is practically like writing
return queue.isReady().then(() => { return scripts.promote(queue, jobId) }).then() ...
If this is not what you meant please correct me

Copy link
Author

Choose a reason for hiding this comment

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

however if you would like to use the previous syntax () => {return ...} (which as i can see is used in this file) then i can edit my pr

Copy link
Member

Choose a reason for hiding this comment

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

no sorry, the code is correct, I did not notice the arrow function.

@manast manast merged commit ec8ad57 into OptimalBits:develop Mar 1, 2020
@chocof chocof deleted the uninitialized_queue_promote_fix branch March 5, 2020 14:20
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.

None yet

4 participants