You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
458 B
16 lines
458 B
import { start, stop } from "../scheduler/engine";
|
|
|
|
const MAX_CONCURRENCY = Number(process.env.SCHEDULER_MAX_CONCURRENCY) || 5;
|
|
const LOG_RETENTION_DAYS = Number(process.env.SCHEDULER_LOG_RETENTION_DAYS) || 30;
|
|
|
|
if (import.meta.dev) {
|
|
console.log("plugin: 03.scheduler");
|
|
}
|
|
|
|
export default defineNitroPlugin(async (nitroApp) => {
|
|
await start(MAX_CONCURRENCY, LOG_RETENTION_DAYS);
|
|
|
|
nitroApp.hooks.hook("close", async () => {
|
|
await stop();
|
|
});
|
|
});
|
|
|