Skip to content

Commit

Permalink
fix plugin name resolution constuctor
Browse files Browse the repository at this point in the history
  • Loading branch information
evantahler committed Nov 4, 2015
1 parent 9b715fa commit 4c051a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
15 changes: 2 additions & 13 deletions examples/customPluginExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,12 @@ var myPlugin = function(worker, func, queue, job, args, options){
// PLUGIN METHODS //
////////////////////

myPlugin.prototype.before_enqueue = function(callback){
callback(null, true);
};

myPlugin.prototype.after_enqueue = function(callback){
callback(null, true);
};

// Learn all the callbacks you can use from the Readme.
myPlugin.prototype.before_perform = function(callback){
console.log(this.options.messagePrefix + " | " + JSON.stringify(this.args));
callback(null, true);
};

myPlugin.prototype.after_perform = function(callback){
callback(null, true);
};

//////////////////////////////
// DEFINE YOUR WORKER TASKS //
//////////////////////////////
Expand Down Expand Up @@ -119,4 +108,4 @@ var shutdown = function(){
});
}, 500);
}
}
};
2 changes: 1 addition & 1 deletion lib/pluginRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var runPlugin = function(self, pluginRefrence, type, func, queue, job, args, cal

var pluginName = pluginRefrence;
if(typeof pluginRefrence === 'function'){
pluginName = new pluginRefrence().name;
pluginName = new pluginRefrence(self, func, queue, job, args, {}).name;
}

var pluginOptions = null;
Expand Down

0 comments on commit 4c051a3

Please sign in to comment.