@golem-sdk/task-executor
Advanced tools
Comparing version 2.0.0-beta.1 to 2.0.0-beta.2
@@ -240,8 +240,13 @@ 'use strict'; | ||
if (task.isRetry()) { | ||
this.retryTask(task).catch((error) => this.logger.error(`Issue with retrying a task on Golem`, error)); | ||
this.retryTask(task) | ||
.catch((error) => this.logger.error(`Issue with retrying a task on Golem`, error)) | ||
.finally(() => --this.activeTasksCount); | ||
} | ||
else if (task.isFinished()) { | ||
this.stopTask(task).catch((error) => this.logger.error(`Issue with stopping a task on Golem`, error)); | ||
this.stopTask(task) | ||
.catch((error) => this.logger.error(`Issue with stopping a task on Golem`, error)) | ||
.finally(() => --this.activeTasksCount); | ||
} | ||
}); | ||
++this.activeTasksCount; | ||
this.startTask(task).catch((error) => !this.abortController.signal.aborted && this.logger.error(`Issue with starting a task on Golem`, error)); | ||
@@ -262,3 +267,2 @@ } | ||
this.logger.debug(`Starting task`, { taskId: task.id, attempt: task.getRetriesCount() + 1 }); | ||
++this.activeTasksCount; | ||
if (task.isFailed()) { | ||
@@ -293,5 +297,2 @@ throw new golemJs.GolemInternalError(`Execution of task ${task.id} aborted due to error. ${task.getError()}`); | ||
} | ||
finally { | ||
--this.activeTasksCount; | ||
} | ||
} | ||
@@ -298,0 +299,0 @@ async retryTask(task) { |
{ | ||
"name": "@golem-sdk/task-executor", | ||
"version": "2.0.0-beta.1", | ||
"version": "2.0.0-beta.2", | ||
"description": "A golem-js based library allowing running computation tasks on Golem, designed for batch map-reduce like scenarios", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/golemfactory/golem-sdk-task-executor", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1771127
4021