Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
🕛 Schedule next job (#1187)
Thibault Le Ouay204ebf043e7b
diff --git a/apps/workflows/src/cron/index.ts b/apps/workflows/src/cron/index.tsindex 11b6c073c..d589d469b 100644--- a/apps/workflows/src/cron/index.ts+++ b/apps/workflows/src/cron/index.ts@@ -75,7 +75,7 @@ app.get("/monitors/:step", async (c) => {switch (schema.data) {case "14days":// We send the first email- await Step14Days(Number(userId));+ await Step14Days(Number(userId), Number(initialRun));break;case "3days":await Step3Days(Number(userId), Number(initialRun));diff --git a/apps/workflows/src/cron/monitor.ts b/apps/workflows/src/cron/monitor.tsindex 9294fc833..1692e3224 100644--- a/apps/workflows/src/cron/monitor.ts+++ b/apps/workflows/src/cron/monitor.ts@@ -186,7 +186,7 @@ async function workflowInit({console.log(`user workflow started for ${user.userId}`);}-export async function Step14Days(userId: number) {+export async function Step14Days(userId: number, workFlowRunTimestamp: number) {const user = await getUser(userId);// Send email saying we are going to pause the monitors@@ -206,6 +206,14 @@ export async function Step14Days(userId: number) {deactivateAt: new Date(new Date().setDate(new Date().getDate() + 14)),}),});++ await CreateTask({+ parent,+ client: client,+ step: "3days",+ userId: user.id,+ initialRun: workFlowRunTimestamp,+ });}}