Permalink
Browse files

fix(ontime): fix to run task at a given specific time (#2)

  • Loading branch information...
mycoboco committed Jan 5, 2018
1 parent 465ab4e commit 5b6fa4f7374409e08aae9054850b64cf30376350
Showing with 3 additions and 4 deletions.
  1. +3 −4 index.js
View
@@ -250,13 +250,12 @@ module.exports = function (sched, job) {
diff = thens[i].then.valueOf()-now.valueOf()
if (diff > 0) {
thens[i].timer = exTimeout(next, diff)
thens[i].count = (thens[i].count+1) % sched.step
info('check for run scheduled after '+info.timeString(diff)+' on '+
thens[i].then)
if (thens[i].count === 0) job(ot)
else info('will wait for '+(sched.step-thens[i].count)+
' step(s) to run')
}
thens[i].count = (thens[i].count+1) % sched.step
if (thens[i].count === 0) job(ot)
else info('will wait for '+(sched.step-thens[i].count)+' step(s) to run')
}
thens[i] = {

0 comments on commit 5b6fa4f

Please sign in to comment.