From 038940860d043439b184c4fbd990f8a71b60c324 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Fri, 4 Nov 2016 10:04:18 -0400 Subject: [PATCH] Added ability to restart tasks that have been completed --- libs/Task.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/Task.js b/libs/Task.js index d86e26a..747f71a 100644 --- a/libs/Task.js +++ b/libs/Task.js @@ -273,9 +273,9 @@ module.exports = class Task{ } // Re-executes the task (by setting it's state back to QUEUED) - // Only tasks that have been canceled or have failed can be restarted. + // Only tasks that have been canceled, completed or have failed can be restarted. restart(cb){ - if (this.status.code === statusCodes.CANCELED || this.status.code === statusCodes.FAILED){ + if ([statusCodes.CANCELED, statusCodes.FAILED, statusCodes.COMPLETED].indexOf(this.status.code) !== -1){ this.setStatus(statusCodes.QUEUED); this.dateCreated = new Date().getTime(); this.output = [];