Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow job to be subscribed for event mapping

  • Loading branch information...
commit 502ed7d19b6d19eb23d2fe5b91185e434391f061 1 parent d1c1a93
@scttnlsn scttnlsn authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/queue/job.js
View
14 lib/queue/job.js
@@ -548,7 +548,7 @@ Job.prototype.save = function(fn){
self.update(fn);
// add the job for event mapping
- events.add(self);
+ self.subscribe();
});
return this;
@@ -589,3 +589,15 @@ Job.prototype.update = function(fn){
// search data
getSearch().index(json, this.id);
};
+
+/**
+ * Subscribe this job for event mapping.
+ *
+ * @return {Job} for chaining
+ * @api public
+ */
+
+Job.prototype.subscribe = function(){
+ events.add(this);
+ return this;
+};
Please sign in to comment.
Something went wrong with that request. Please try again.