Comparing version
@@ -162,5 +162,9 @@ "use strict"; | ||
function getDelay(timeMatcher, currentDate) { | ||
const maxDelay = 86400000; | ||
const nextRun = timeMatcher.getNextMatch(currentDate); | ||
const now = new Date(); | ||
const delay = nextRun.getTime() - now.getTime(); | ||
if (delay > maxDelay) { | ||
return maxDelay; | ||
} | ||
return Math.max(0, delay); | ||
@@ -167,0 +171,0 @@ } |
@@ -162,5 +162,9 @@ "use strict"; | ||
function getDelay(timeMatcher, currentDate) { | ||
const maxDelay = 86400000; | ||
const nextRun = timeMatcher.getNextMatch(currentDate); | ||
const now = new Date(); | ||
const delay = nextRun.getTime() - now.getTime(); | ||
if (delay > maxDelay) { | ||
return maxDelay; | ||
} | ||
return Math.max(0, delay); | ||
@@ -167,0 +171,0 @@ } |
{ | ||
"name": "node-cron", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "A Lightweight Task Scheduler for Node.js", | ||
@@ -5,0 +5,0 @@ "author": "Lucas Merencia", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
212589
0.18%3109
0.26%2
-33.33%