mirror of
https://github.com/fabrice404/olympics-calendar.git
synced 2026-02-14 12:19:04 +00:00
20 lines
417 B
TypeScript
20 lines
417 B
TypeScript
import { removeSync } from "fs-extra/esm";
|
|
import nodeCron from "node-cron";
|
|
|
|
import { Scraper } from "./scraper";
|
|
|
|
const main = () => {
|
|
nodeCron.schedule("*/1 * * * *", () => {
|
|
removeSync("./cache/schedules");
|
|
const scraper = new Scraper();
|
|
scraper.scrape();
|
|
});
|
|
|
|
nodeCron.schedule("0 0 * * *", () => {
|
|
removeSync("./cache/disciplinesevents");
|
|
removeSync("./cache/nocs");
|
|
});
|
|
};
|
|
|
|
main();
|