Permalink
Browse files

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

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
  • Loading branch information...
ncb000gt committed May 9, 2012
1 parent 33d38fc commit b9b29fef029acd397c5c385e4629b2107c04693b
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/cron.js
View
@@ -279,14 +279,15 @@ CronJob.prototype = {
start: function() {
if(this.running) return;
var timeout = this.cronTime.getTimeout();
+ if (this.cronTime.realDate) this.runOnce = true;
if (timeout >= 0) {
this.running = true;
this._timeout = setTimeout(function(self) {
self.running = false;
//start before calling back so the callbacks have the ability to stop the cron job
- self.start();
+ if (!(self.runOnce)) self.start();;
self._callback();
}, timeout, this);

0 comments on commit b9b29fe

Please sign in to comment.