MCPcopy Index your code
hub / github.com/node-schedule/node-schedule / runAtDate

Function runAtDate

test/utils/timerUtils.js:6–19  ·  view source on GitHub ↗
(date, func)

Source from the content-addressed store, hash-verified

4// So we need additional logic to handle large delays
5
6function runAtDate(date, func) {
7 const now = (new Date()).getTime();
8 const then = date.getTime();
9 const diff = Math.max((then - now), 0);
10
11 //setTimeout limit is MAX_INT32=(2^31-1)
12 if (diff > 0x7FFFFFFF) {
13 setTimeout(function() { runAtDate(date, func);},
14 0x7FFFFFFF);
15 }
16 else {
17 setTimeout(func, diff);
18 }
19}
20
21module.exports = {
22 runAtDate

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…