MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / nextAfter

Function nextAfter

src/schedule/cron.ts:115–126  ·  view source on GitHub ↗
(cron: CronExpression, after: Date)

Source from the content-addressed store, hash-verified

113 * expression can't lock the scheduler.
114 */
115export function nextAfter(cron: CronExpression, after: Date): Date | null {
116 const limit = 60 * 24 * 366 * 2;
117 const probe = new Date(after.getTime());
118 // Round up to next minute boundary so we don't yield `after` itself.
119 probe.setSeconds(0, 0);
120 probe.setMinutes(probe.getMinutes() + 1);
121 for (let i = 0; i < limit; i++) {
122 if (matches(cron, probe)) return probe;
123 probe.setMinutes(probe.getMinutes() + 1);
124 }
125 return null;
126}

Callers 3

schedule.test.tsFile · 0.85
addMethod · 0.85
recomputeNextMethod · 0.85

Calls 1

matchesFunction · 0.85

Tested by

no test coverage detected