Skip to content

Commit

Permalink
Add onInitTasks option
Browse files Browse the repository at this point in the history
Change-type: minor
  • Loading branch information
joshbwlng committed Nov 29, 2024
1 parent 4591a3a commit e78aeb7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ export interface SetupOptions {
onInitModel?: SetupFunction;
onInitHooks?: SetupFunction;
onInitRoutes?: SetupFunction;
onInitTasks?: SetupFunction;

onLogin?: (
user: Pick<User['Read'], (typeof defaultFindUser$select)[number]>,
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit e78aeb7

Please sign in to comment.