From 230704f99a18eb47cf326c7e3d5146b8ca48db78 Mon Sep 17 00:00:00 2001 From: Saahil Date: Tue, 7 Jan 2025 19:22:36 -0500 Subject: [PATCH] fix: cron --- src/modules/parseShipments.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/parseShipments.ts b/src/modules/parseShipments.ts index db725be..0d2488e 100644 --- a/src/modules/parseShipments.ts +++ b/src/modules/parseShipments.ts @@ -2,6 +2,7 @@ import { AnyBlock, Block } from "@slack/bolt"; import { ModifiedApp } from "./slackapp"; import cron from "node-cron"; import { text } from "body-parser"; +import { Cron } from "croner"; const cheerio = require("cheerio"); export function createShipmentURL(token: string, email: string) { return `https://shipment-viewer.hackclub.com/dyn/jason/${encodeURI(email)}?email=${encodeURIComponent(email)}&signature=${token}&show_ids=yep`; @@ -211,7 +212,7 @@ export function getShipmentDiff( } export function setupCronForShipments(app: ModifiedApp) { - cron.schedule("*/2 * * * *", async () => { + new Cron("*/2 * * * *", async () => { const allUsersWithAShipmentURL = Object.keys(app.db.JSON()).filter((e) => e.startsWith(`shipment_url_`), );