mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-25 19:16:19 +00:00
usar croner en vez de cron
uso de memoria?
This commit is contained in:
parent
923dd0b910
commit
dbdd19a4c2
3 changed files with 4 additions and 9 deletions
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue