Code Monkey home page Code Monkey logo

Comments (10)

rschmukler avatar rschmukler commented on May 12, 2024

Hey sorry for the delay. Your Mongo is likely too old a version. You need
at least Mongo 2.4+. Let me know if the works.

from agenda.

dadaista avatar dadaista commented on May 12, 2024

hi thank you, with 2.4.9 it starts nicely, but the task is executed only once :o. I supposed it was a periodic task.

D.

from agenda.

rschmukler avatar rschmukler commented on May 12, 2024

Can you run the following in the mongo console and paste the output....

db.agendaJobs.find().toArray()

from agenda.

dadaista avatar dadaista commented on May 12, 2024

[
{
"_id" : ObjectId("532f157d912a9cf106a6e1f0"),
"data" : null,
"lockedAt" : ISODate("2014-03-23T17:10:21.628Z"),
"name" : "a task",
"nextRunAt" : ISODate("2014-03-23T17:10:21.622Z"),
"priority" : 0,
"repeatInterval" : "1 minutes",
"type" : "single"
}
]

from agenda.

jameswyse avatar jameswyse commented on May 12, 2024

You forgot to call done() 😄

var Agenda = require('agenda');
var agenda = new Agenda({db: { address: 'localhost:27017/agenda-example'}});

agenda.define('a task', function(job, done) {
  console.log("a task is running ... say hello");
  done();
});

agenda.every('1 minutes', 'test');
agenda.start();
a task is running ... say hello
a task is running ... say hello
a task is running ... say hello
^C

from agenda.

dadaista avatar dadaista commented on May 12, 2024

Ooops, thanx. Now it works well on Ubuntu13/mongo2.4.9. Unfortunately there is another issue on OSX10.9.2/mongo2.4.8.

see paste http://pastebin.com/1CA9X9ZG

Another insidious aspect of this issue is that the error is presented only at first launch, if you relaunch the code it silently runs without actually executing tasks.

from agenda.

rschmukler avatar rschmukler commented on May 12, 2024

@dadaista that error is basically what happens when you try and run a job that isn't defined.

from agenda.

dadaista avatar dadaista commented on May 12, 2024

@rschmukler yeah, but the same code works well in ubuntu :o

from agenda.

rschmukler avatar rschmukler commented on May 12, 2024

@dadaista that's likely because the job that is undefined does not exist in your ubuntu database, but does in your other.

Can you give me the content of the agendaJobs database and the definition file so I can get a better idea of what's going on?

from agenda.

rschmukler avatar rschmukler commented on May 12, 2024

Closing for lack of activity, please re-open whenever you can.

from agenda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.