mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-06-09 18:51:16 +00:00
feat(db): add attemptCount on SkippedPackage + CHANNEL_ACCESS_LOST enum
attemptCount tracks how many times the worker has tried each failed source message. Combined with WORKER_MAX_SKIP_ATTEMPTS (default 5), the worker will auto-retry across cycles but eventually let the watermark advance past a chronically failing file so cycles aren't pinned forever. The SkippedPackage row stays so the user can manually retry via the UI. CHANNEL_ACCESS_LOST is a new notification type the worker emits when a source channel becomes inaccessible (account got removed, channel deleted, etc.) — surfaces the issue instead of silently failing every cycle as we've been doing with "Iridium 2 w/ Add-ons [Completed]". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
-- AlterTable: track how many times the worker has tried each skipped source message.
|
||||
-- Existing rows default to 1 (they represent a single past attempt that the worker
|
||||
-- chose to record). Future failures increment via upsertSkippedPackage.
|
||||
ALTER TABLE "skipped_packages" ADD COLUMN "attemptCount" INTEGER NOT NULL DEFAULT 1;
|
||||
|
||||
-- AlterEnum: add CHANNEL_ACCESS_LOST so the worker can surface a notification
|
||||
-- when a source channel becomes inaccessible (account removed, channel deleted, etc.)
|
||||
ALTER TYPE "NotificationType" ADD VALUE 'CHANNEL_ACCESS_LOST';
|
||||
@@ -741,6 +741,12 @@ model SkippedPackage {
|
||||
sourceTopicId BigInt?
|
||||
isMultipart Boolean @default(false)
|
||||
partCount Int @default(1)
|
||||
/// How many times the worker has tried to process this source message.
|
||||
/// The worker auto-retries failures across cycles up to a configurable cap
|
||||
/// (WORKER_MAX_SKIP_ATTEMPTS, default 5). After the cap, the watermark is
|
||||
/// allowed to advance past the failure so cycles aren't pinned forever;
|
||||
/// the user can manually retry via the UI to reset and try again.
|
||||
attemptCount Int @default(1)
|
||||
accountId String
|
||||
account TelegramAccount @relation(fields: [accountId], references: [id], onDelete: Cascade)
|
||||
createdAt DateTime @default(now())
|
||||
@@ -830,6 +836,7 @@ enum NotificationType {
|
||||
DOWNLOAD_FAILED
|
||||
GROUPING_CONFLICT
|
||||
INTEGRITY_AUDIT
|
||||
CHANNEL_ACCESS_LOST
|
||||
}
|
||||
|
||||
enum NotificationSeverity {
|
||||
|
||||
Reference in New Issue
Block a user