padolsey/cron.js

jobs with step speicified not working

Opened this issue · 2 comments

here's a patch:

diff --git a/cron.js b/cron.js
index 0c7ef86..160d544 100644
--- a/cron.js
+++ b/cron.js
@@ -77,7 +77,7 @@ var CronJob = (function(){

             field.replace(rangePattern, function($0, lower, upper, step) {
  •                step = step || 1;
    
  •                step = step && parseInt(step) || 1;
    
                 // Positive integer higher than constraints[0]
                 lower = Math.max(low, ~~Math.abs(lower));
    

Hi James,
Did you include this patch in the current version or the issue is still open? It is a pity you stopped working on cron.js. Either I was very unlucky searching for a scheduling library for Node, or there are not many better alternatives to yours around.

G.

@darren Sorry for the, urr, delay. I'm interested in how your fix works. In what cases were steps not working?

@giacecco Not sure what happened. tbh, oddly, I've never even needed cron jobs in JS -- this was a hobby project at the time, if I remember correctly. Anyway, I'm making an effort to re-visit my older repos and apply fixes where necessary. :) Regarding node though, are you following the node-specific fork of this script? - https://github.com/ncb000gt/node-cron