Skip to content

Commit 1c0082b

Browse files
author
Ugo Plouviez
committed
Remove unnecessary method
1 parent d65cd4a commit 1c0082b

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/main/java/com/iexec/worker/executor/TaskExecutorService.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,6 @@ public void tryToContribute(ContributionAuthorization contributionAuth) {
126126
return;
127127
}
128128

129-
// TODO: not sure if this is needed !
130-
// if contribution deadline is passed then no need to contribute
131-
if (contributionService.isContributionDeadlineReached(chainTaskId)) {
132-
log.error("The contribution deadline has been already reached, no more contributions are allowed [chain]"
133-
+ " [chainTaskId:{}, contribAuth:{}]", chainTaskId, contributionAuth);
134-
return;
135-
}
136-
137129
boolean isResultAvailable = resultService.isResultAvailable(chainTaskId);
138130

139131
if (!isResultAvailable) {
@@ -280,11 +272,11 @@ private String tryToDownloadData(TaskDescription taskDescription) {
280272
private String checkContributionAbility(String chainTaskId) {
281273
String errorMessage = "";
282274

283-
Optional<ReplicateStatus> statusBeforeDownloadApp = contributionService.getCanContributeStatus(chainTaskId);
284-
if(statusBeforeDownloadApp.isPresent() && !statusBeforeDownloadApp.get().equals(CAN_CONTRIBUTE)) {
275+
Optional<ReplicateStatus> contributionStatus = contributionService.getCanContributeStatus(chainTaskId);
276+
if(contributionStatus.isPresent() && !contributionStatus.get().equals(CAN_CONTRIBUTE)) {
285277
errorMessage = "The worker cannot contribute";
286-
log.error(errorMessage + " [chainTaskId:{}, replicateStatus:{}]", chainTaskId, statusBeforeDownloadApp.get());
287-
customFeignClient.updateReplicateStatus(chainTaskId, statusBeforeDownloadApp.get());
278+
log.error(errorMessage + " [chainTaskId:{}, replicateStatus:{}]", chainTaskId, contributionStatus.get());
279+
customFeignClient.updateReplicateStatus(chainTaskId, contributionStatus.get());
288280
return errorMessage;
289281
}
290282

0 commit comments

Comments
 (0)