Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Make sure date values only fire once per GH-34.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
  • Loading branch information...
commit b9b29fef029acd397c5c385e4629b2107c04693b 1 parent 33d38fc
Nick Campbell authored May 09, 2012

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  lib/cron.js
3  lib/cron.js
@@ -279,6 +279,7 @@ CronJob.prototype = {
279 279
   start: function() {
280 280
     if(this.running) return;
281 281
     var timeout = this.cronTime.getTimeout();
  282
+    if (this.cronTime.realDate) this.runOnce = true;
282 283
 
283 284
     if (timeout >= 0) {
284 285
       this.running = true;
@@ -286,7 +287,7 @@ CronJob.prototype = {
286 287
             self.running = false;
287 288
 
288 289
             //start before calling back so the callbacks have the ability to stop the cron job
289  
-            self.start();
  290
+            if (!(self.runOnce)) self.start();;
290 291
 
291 292
             self._callback();
292 293
           }, timeout, this);

0 notes on commit b9b29fe

Please sign in to comment.
Something went wrong with that request. Please try again.