From 19b63321dd6f75c3224ae5fb27e31b62e7fb68fd Mon Sep 17 00:00:00 2001 From: Inga Lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Thu, 28 Nov 2013 14:55:09 +0400 Subject: [PATCH] Fixed a bug in task-processor At the moment of call to taskImpl, processor should be created --- BuildServer/lib/task-processor.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/BuildServer/lib/task-processor.js b/BuildServer/lib/task-processor.js index da51f0d..2087c82 100644 --- a/BuildServer/lib/task-processor.js +++ b/BuildServer/lib/task-processor.js @@ -7,8 +7,8 @@ var TaskProcessor = function (task, outerProcessor, callback) { } var self = this, - taskImpl = require('./tasks/' + task.type.match(/[\w\-]/g).join("")), - taskWorker = taskImpl(task.params, self), + taskImpl, + taskWorker, errors = [], process = function () { taskWorker.process(); @@ -41,6 +41,9 @@ var TaskProcessor = function (task, outerProcessor, callback) { self.processTask = processTask; self.done = done; self.context = outerProcessor.context; + + taskImpl = require('./tasks/' + task.type.match(/[\w\-]/g).join("")); + taskWorker = taskImpl(task.params, self); }; exports.processTask = function (task, context, callback) {