MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / _onCronFire

Method _onCronFire

packages/server/src/schedule/ScheduleBeat.ts:224–246  ·  view source on GitHub ↗

* Callback fired by node-cron. Delegates to the shared ScheduleExecutor * with Beat-specific cleanup callbacks.

(scheduleRecordId: string)

Source from the content-addressed store, hash-verified

222 * with Beat-specific cleanup callbacks.
223 */
224 private async _onCronFire(scheduleRecordId: string): Promise<void> {
225 const appServer = getRunningExpressApp()
226 const ctx = {
227 appDataSource: appServer.AppDataSource,
228 componentNodes: appServer.nodesPool.componentNodes,
229 telemetry: appServer.telemetry,
230 cachePool: appServer.cachePool,
231 usageCacheManager: appServer.usageCacheManager,
232 sseStreamer: appServer.sseStreamer,
233 identityManager: appServer.identityManager
234 }
235
236 await executeScheduleJob(ctx, scheduleRecordId, {
237 onRecordNotFoundOrDisabled: () => {
238 this._removeCronJob(scheduleRecordId)
239 },
240 onRecordExpiredOrInvalid: async (record) => {
241 record.enabled = false
242 await appServer.AppDataSource.getRepository(ScheduleRecord).save(record)
243 this._removeCronJob(record.id)
244 }
245 })
246 }
247}

Callers 2

_upsertCronJobMethod · 0.95

Calls 3

_removeCronJobMethod · 0.95
getRunningExpressAppFunction · 0.90
executeScheduleJobFunction · 0.90

Tested by

no test coverage detected