-
Notifications
You must be signed in to change notification settings - Fork 16
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
Check if Worker can still accept more work right before giving it a new replicate #644
Conversation
@@ -104,11 +99,16 @@ Optional<ReplicateTaskSummary> getAvailableReplicateTaskSummary(long workerLastB | |||
|
|||
// TODO : Remove this, the optional can never be empty |
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.
This TODO can be removed. It was relevant before the optimization.
Now worker
becomes an argument from canAcceptMoreWorks
.
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.
Good catch! Please see d0c0db7.
CHANGELOG.md
Outdated
@@ -2,6 +2,12 @@ | |||
|
|||
All notable changes to this project will be documented in this file. | |||
|
|||
## [[8.2.3]](https://github.com/iExecBlockchainComputing/iexec-core/releases/tag/v8.2.3) 2023-12-13 |
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.
## [[8.2.3]](https://github.com/iExecBlockchainComputing/iexec-core/releases/tag/v8.2.3) 2023-12-13 | |
## [[8.2.3]](https://github.com/iExecBlockchainComputing/iexec-core/releases/tag/v8.2.3) 2023-12-14 |
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.
Thanks for the reminder. Please see caff7a7.
final Optional<ReplicatesList> oReplicatesList = replicatesService.getReplicatesList(chainTaskId); | ||
// Check is only here to prevent | ||
// "`Optional.get()` without `isPresent()` warning". | ||
// This case should not happen. | ||
if (oReplicatesList.isEmpty()) { | ||
return false; | ||
} | ||
|
||
final ReplicatesList replicatesList = oReplicatesList.get(); |
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.
Maybe this more condensed form to avoid unnecessary final Optional
?
final Optional<ReplicatesList> oReplicatesList = replicatesService.getReplicatesList(chainTaskId); | |
// Check is only here to prevent | |
// "`Optional.get()` without `isPresent()` warning". | |
// This case should not happen. | |
if (oReplicatesList.isEmpty()) { | |
return false; | |
} | |
final ReplicatesList replicatesList = oReplicatesList.get(); | |
final ReplicatesList replicatesList = replicatesService.getReplicatesList(chainTaskId).orElse(null); | |
if (replicatesList == null) { | |
return false; | |
} |
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.
This can totally be done at a later time or not at all
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.
You're right we can do something better. I've tried the functional way. Let me know if it suits you :)
5ddcf26
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
No description provided.