Comparing version 0.5.8 to 0.5.9
0.5.9 / 2014-03-10 | ||
================== | ||
* add job#remove method | ||
0.5.8 / 2014-03-07 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -140,2 +140,6 @@ var humanInterval = require('human-interval'), | ||
Job.prototype.remove = function(cb) { | ||
this.agenda._db.remove({_id: this.attrs._id}, cb); | ||
}; | ||
function parsePriority(priority) { | ||
@@ -142,0 +146,0 @@ var priorityMap = { |
{ | ||
"name": "agenda", | ||
"version": "0.5.8", | ||
"version": "0.5.9", | ||
"description": "Light weight job scheduler for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -421,2 +421,12 @@ # Agenda | ||
### remove(callback) | ||
Removes the `job` from the database. | ||
```js | ||
job.save(function(err) { | ||
if(!err) console.log("Successfully saved job to collection"); | ||
}) | ||
``` | ||
## Job Queue Events | ||
@@ -423,0 +433,0 @@ |
@@ -284,2 +284,18 @@ var mongoCfg = 'localhost:27017/agenda-test', | ||
describe('remove', function() { | ||
it('removes the job', function(done) { | ||
var job = new Job({agenda: jobs, name: 'removed job'}); | ||
job.save(function(err) { | ||
if(err) return done(err); | ||
job.remove(function(err) { | ||
if(err) return done(err); | ||
mongo.collection('agendaJobs').find({_id: job.attrs._id}).toArray(function(err, j) { | ||
expect(j).to.have.length(0); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
describe('run', function() { | ||
@@ -286,0 +302,0 @@ var job, |
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
45481
844
573