From e78aeb7114b0d47b4c11d1e7f50082e68c81ecd3 Mon Sep 17 00:00:00 2001 From: Josh Bowling Date: Wed, 27 Nov 2024 22:41:59 +0900 Subject: [PATCH] Add onInitTasks option Change-type: minor --- src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.ts b/src/index.ts index 20e6c7569..0cbc67061 100644 --- a/src/index.ts +++ b/src/index.ts @@ -298,6 +298,7 @@ export interface SetupOptions { onInitModel?: SetupFunction; onInitHooks?: SetupFunction; onInitRoutes?: SetupFunction; + onInitTasks?: SetupFunction; onLogin?: ( user: Pick, @@ -414,6 +415,7 @@ export async function setup(app: Application, options: SetupOptions) { pine.env.tasks.queueIntervalMS = PINEJS_QUEUE_INTERVAL_MS; await pine.tasks.setup(); await import('./tasks.js'); + await options.onInitTasks?.(app); await pine.tasks.worker?.start(); }