fix(discord) : cancel sync after three failed attempts
CI / Verify (push) Successful in 2m13s
CI / Build immutable images and deploy (push) Successful in 1m50s

This commit is contained in:
2026-10-12 19:54:30 +07:00 Unverified
parent fae9e146e1
commit 195b14b30b
+2 -1
View File
@@ -12,7 +12,7 @@ import {
} from "@/lib/catalog/sync";
import { closeRedisClient, discordWorkerHeartbeatKey, getRedisClient } from "@/lib/redis/client";
const RETRY_DELAYS_MS = [0, 30_000, 120_000, 600_000, 1_800_000] as const;
const RETRY_DELAYS_MS = [0, 30_000, 120_000] as const;
function required(name: string): string {
const value = process.env[name]?.trim();
@@ -114,6 +114,7 @@ async function syncWithRetry(messageUrl: string): Promise<void> {
if (cancellation.signal.aborted) return;
const message = cause instanceof Error ? cause.message : String(cause);
if (attempt === RETRY_DELAYS_MS.length - 1) {
cancellation.abort();
const details = { attempts: attempt + 1, error: message };
log("sync_failed", details);
await notify("sync failed", details);