Giter VIP home page Giter VIP logo

meteor.cron's People

Contributors

alexsuslov avatar veeamgmbh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

laboratory

meteor.cron's Issues

Example Not Working

This is my code:

var hello = function() {
  console.log("WORLD");
}

var cron = new Meteor.Cron({
  events: {
    "0 * * * *": hello()
  }
});

In my browser console it prints "WORLD" just once then I get an error of Uncaught TypeError: undefined is not a function

Only basic crontab syntax works

It would be great if the documentation would reflect that typical crontab entries with comma seperated values, ranges or -notation do not work with this implementation.

For example */15 4-16 * * 6,7 is valid crontab syntax. (Every 15 minutes between 4 AM and 4 PM on saturdays and sundays.) It doesn't work with the implementation though.

TypeError: Property 'func' of object [object Object] is not a function

I20160127-05:40:00.366(2)? Exception in setInterval callback: TypeError: Property 'func' of object [object Object] is not a function
I20160127-05:40:00.366(2)?     at Cron.Meteor.Cron.Cron.doEvent (packages/mrt_cron/packages/mrt_cron.js:90:1)
I20160127-05:40:00.367(2)?     at Cron.Meteor.Cron.Cron.do (packages/mrt_cron/packages/mrt_cron.js:102:1)
I20160127-05:40:00.367(2)?     at packages/mrt_cron/packages/mrt_cron.js:66:1
I20160127-05:40:00.367(2)?     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20160127-05:40:00.367(2)?     at packages/meteor/timers.js:6:1
I20160127-05:40:00.367(2)?     at runWithEnvironment (packages/meteor/dynamics_nodejs.js:110:1)

why run double world function

var world = function () {
console.log('World!');
}
var cron = new Meteor.Cron( {
events:{
"* * * * *" : world
}
});

Is the code example correct?

I was having a hard time creating a new Cron object following this example code:

var world= function (){
      console.log('World!');
    }
    var myBirthDay= function (){
      console.log('my Birth Day!');
    }
    var crone = new Meteor.Cron{
      events:{
        "* * * * *": "world",
        "0 0 18 6 *":"myBirthDay"
      }
    }

Meteor.Cron{...} was giving me an error, so I tried wrapping everything in parenthesis. Also, I was getting TypeError: Property 'func' of object #<Object> is not a function in each of the events. I had to not pass strings, but the functions themselves. The resulting code is:

var world= function (){
      console.log('World!');
    }
    var myBirthDay= function (){
      console.log('my Birth Day!');
    }
    var crone = new Meteor.Cron({
      events:{
        "* * * * *": world,
        "0 0 18 6 *": myBirthDay
      }
    });

Am I correct, or am I missing something? Great package, thanks!

Replace hardcoded ***** with parameters

Is it possible to pass args to a function and replace '* * * * *' with those arguments? I'm trying

`var day = '';
var month = '
';
var hour = '';
var min = '
';
//these values will ultimately be something else obviously

function doJob(day, month, hour, min) {
var time = '' + min + ' ' + hour + ' ' + day + ' ' + month + ' *';
var cron = new Meteor.Cron({
events:{
time : test
}
});
return cron;
}`

but this doesn't work unfortunately. No errors, just no response from the cronjob i.e. it doesn't do anything.

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.