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.4.1 to 0.4.2

5

History.md
0.4.2 / 2013-12-11
==================
* Refactored Job to ensure that everything is stored as an ISODate in the Database. [Closes #14] [@raisch]
0.4.1 / 2013-12-10

@@ -3,0 +8,0 @@ ==================

17

lib/agenda.js

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

var fn = cb;
var props = getJobProperties(job);
var props = job.toJSON();
delete props._id;
if(props.type == 'single')

@@ -151,3 +155,5 @@ this._db.findAndModify({name: props.name, type: 'single'}, {}, {$set: props}, {upsert: true, new: true}, processDbResult);

self = this;
var now = new Date();
this.jobs({nextRunAt: {$lte: now}}, {sort: {'priority': -1}}, function(err, jobs) {

@@ -183,10 +189,1 @@ if(err) throw(err);

}
function getJobProperties(job) {
var props = {};
for(var key in job.attrs) {
props[key] = job.attrs[key];
}
delete props._id;
return props;
}

@@ -26,2 +26,17 @@ var humanInterval = require('human-interval'),

Job.prototype.toJSON=function(){ // create a persistable Mongo object -RR
var self=this,
attrs=self.attrs||{};
return {
_id: attrs._id,
name: attrs.name,
data: attrs.data,
priority: attrs.priority,
lastRunAt: attrs.lastRunAt ? new Date(attrs.lastRunAt) : null,
lastFinishedAt:attrs.lastFinishedAt ? new Date(attrs.lastFinishedAt) : null,
nextRunAt: attrs.nextRunAt ? new Date(attrs.nextRunAt) : null,
repeatInterval:attrs.repeatInterval,
type: attrs.type
};
};

@@ -28,0 +43,0 @@ Job.prototype.computeNextRunAt = function() {

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

@@ -5,0 +5,0 @@ "main": "index.js",

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