MCPcopy
hub / github.com/node-cron/node-cron / execute

Method execute

src/scheduler/runner.ts:174–194  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172
173 if(shouldExecute){
174 const execute = async () => {
175 try {
176 this.runCount++;
177 execution.startedAt = new Date();
178 const result = await this.onMatch(date, execution);
179 execution.finishedAt = new Date();
180 execution.result = result;
181 this.onFinished(date, execution);
182
183 if( this.maxExecutions && this.runCount >= this.maxExecutions){
184 this.onMaxExecutions(date);
185 this.stop();
186 }
187 } catch (error: any){
188 execution.finishedAt = new Date();
189 execution.error = error;
190 this.onError(date, error, execution);
191 }
192
193 resolve(true);
194 };
195
196 // The jitter timer only earns its macrotask hop when a random delay is
197 // actually configured. With the default maxRandomDelay of 0 the delay

Callers

nothing calls this directly

Calls 3

stopMethod · 0.95
createIDFunction · 0.90
onFinishedMethod · 0.45

Tested by

no test coverage detected