usar croner en vez de cron

uso de memoria?
This commit is contained in:
Cat /dev/Nulo 2024-01-06 23:03:16 -03:00
parent 923dd0b910
commit dbdd19a4c2
3 changed files with 4 additions and 9 deletions

BIN
bun.lockb

Binary file not shown.

View file

@ -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"
}

View file

@ -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();
});
}