Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

agenda

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agenda - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

6

History.md
0.2.0 / 2013-11-07
==================
* Added error for running undefined job. [Closes #4]
* Fixed critical error where new jobs are not correctly saved.
0.1.3 / 2013-11-06

@@ -3,0 +9,0 @@ ==================

19

lib/agenda.js

@@ -104,5 +104,8 @@ var Job = require('./job.js'),

else {
var query = {};
if(job.attrs._id) query._id = job.attrs._id;
this._db.findAndModify(query, {$set: props}, {upsert: true, new: true}, processDbResult);
if(job.attrs._id) {
this._db.findAndModify({_id: job.attrs._id}, {}, {$set: props}, processDbResult);
}
else {
this._db.insert(props, processDbResult);
}
}

@@ -112,4 +115,9 @@

if(err) throw(err);
else if(res && typeof res == 'object')
job.attrs._id = res._id;
else if(res) {
if (Array.isArray(res)) {
job.attrs._id = res[0]._id;
} else if(typeof res == 'object') {
job.attrs._id = res._id;
}
}

@@ -158,2 +166,3 @@ if(fn)

definition = definitions[jobs[index].attrs.name];
if(!definition) throw new Error("Attempted to run job undefined job: " + jobs[index].attrs.name);
if(definition.concurrency > definition.running) {

@@ -160,0 +169,0 @@ job = jobs[index];

{
"name": "agenda",
"version": "0.1.3",
"version": "0.2.0",
"description": "Light weight job scheduler for Node.js",

@@ -19,9 +19,6 @@ "main": "index.js",

"job",
"jobs",
"delayed",
"job",
"job",
"scheduler",
"job",
"runner",
"delayed"
"runner"
],

@@ -28,0 +25,0 @@ "author": "Ryan Schmukler <ryan@slingingcode.com> (http://slingingcode.com/)",

@@ -91,2 +91,4 @@ var expect = require('expect.js'),

jobs.define('someJob', jobProcessor);
jobs.define('send email', jobProcessor);
jobs.define('some job', jobProcessor);
});

@@ -163,3 +165,2 @@

it('sets the repeat interval', function() {
debugger;
job.repeatEvery(5000);

@@ -166,0 +167,0 @@ expect(job.attrs.repeatInterval).to.be(5000);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc