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.0 to 0.4.1

5

History.md
0.4.1 / 2013-12-10
==================
* Added support for synchronous job definitions
0.4.0 / 2013-12-04

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

11

lib/job.js

@@ -82,3 +82,4 @@ var humanInterval = require('human-interval'),

try {
definition.fn(self, function() {
var jobFinishedSuccessfully = function(err) {
if(err) throw err;
now = new Date();

@@ -91,3 +92,9 @@ agenda._runningJobs--;

agenda.emit('success:' + self.attrs.name, self);
});
};
if(definition.fn.length == 2) {
definition.fn(self, jobFinishedSuccessfully);
} else {
definition.fn(self);
jobFinishedSuccessfully();
}
} catch(e) {

@@ -94,0 +101,0 @@ now = new Date();

2

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

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

@@ -159,3 +159,4 @@ # Agenda

will be passed to `fn(job, done)`. To maintain asynchronous behavior, you must
call `done()` when you are processing the job.
call `done()` when you are processing the job. If your function is synchronous,
you may omit `done` from the signature.

@@ -181,2 +182,3 @@ `options` is an optional argument which can overwrite the defaults. It can take

Async Job:
```js

@@ -192,2 +194,10 @@ agenda.define('some long running job', function(job, done) {

Sync Job:
```js
agenda.define('say hello', function(job) {
console.log("Hello!");
});
```
## Creating Jobs

@@ -194,0 +204,0 @@

@@ -203,3 +203,3 @@ var expect = require('expect.js'),

describe.only('computeNextRunAt', function() {
describe('computeNextRunAt', function() {
var job;

@@ -206,0 +206,0 @@

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