diff --git a/server/plugins/04.rss-scheduler.ts b/server/plugins/04.rss-scheduler.ts index 99e2bbb..40804dc 100644 --- a/server/plugins/04.rss-scheduler.ts +++ b/server/plugins/04.rss-scheduler.ts @@ -2,21 +2,19 @@ import { syncAllDueFeeds } from "#server/service/rss"; const MIN_INTERVAL_MS = 60_000; -export default defineNitroPlugin((nitroApp) => { - nitroApp.hooks.hook("ready", () => { - const minutes = Number(process.env.RSS_SYNC_INTERVAL_MINUTES ?? 60); - const intervalMs = Math.max(minutes * 60_000, MIN_INTERVAL_MS); +export default defineNitroPlugin(() => { + const minutes = Number(process.env.RSS_SYNC_INTERVAL_MINUTES ?? 60); + const intervalMs = Math.max(minutes * 60_000, MIN_INTERVAL_MS); - setInterval(() => { - syncAllDueFeeds().catch((e) => { - console.error("[rss-scheduler]", e); - }); - }, intervalMs); + setInterval(() => { + syncAllDueFeeds().catch((e) => { + console.error("[rss-scheduler]", e); + }); + }, intervalMs); - setTimeout(() => { - syncAllDueFeeds().catch((e) => { - console.error("[rss-scheduler] startup", e); - }); - }, 5000); - }); + setTimeout(() => { + syncAllDueFeeds().catch((e) => { + console.error("[rss-scheduler] startup", e); + }); + }, 5000); });