diff --git a/bun.lockb b/bun.lockb index 1dffe92..bfdf8e4 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/sitio/package.json b/sitio/package.json index 575e1f4..ee66782 100644 --- a/sitio/package.json +++ b/sitio/package.json @@ -38,7 +38,7 @@ "better-sqlite3": "^9.2.2", "chart.js": "^4.4.1", "chartjs-adapter-dayjs-4": "^1.0.4", - "cron": "^3.1.6", + "croner": "^8.0.0", "dayjs": "^1.11.10", "drizzle-orm": "^0.29.1" } diff --git a/sitio/src/hooks.server.ts b/sitio/src/hooks.server.ts index 7358ae5..a7fc486 100644 --- a/sitio/src/hooks.server.ts +++ b/sitio/src/hooks.server.ts @@ -1,14 +1,9 @@ import { spawn } from "child_process"; -import { CronJob } from "cron"; +import Cron from "croner"; if (process.env.NODE_ENV === "production") { - const job = CronJob.from({ - cronTime: "0 3 * * *", - onTick: function () { - runScraper(); - }, - start: true, - timeZone: "America/Argentina/Buenos_Aires", + const job = Cron("15 3 * * *", () => { + runScraper(); }); }