feat: per-source pause/stop controls for queue admin
Add operator pause/resume/stop/start for individual adapter sources, persisted in queue_state. Pause freezes draining and retains jobs; stop clears pending/backoff jobs and blocks re-enqueue until start. Wires admin tRPC endpoints plus a clean two-row Actions layout in the queue admin page.
This commit is contained in:
@@ -1305,6 +1305,10 @@ export const api = {
|
||||
queueLogs: (key: string, limit: number) => trpcQuery<ErrorLogEntry[]>("admin.queueLogs", { key, limit }),
|
||||
queueRetryJob: (key: string) => trpcMutate<{ ok: boolean }>("admin.queueRetryJob", { key }),
|
||||
queueRetrySource: (sourceKind: string) => trpcMutate<{ cleared: number }>("admin.queueRetrySource", { sourceKind }),
|
||||
queueSourcePause: (source: string) => trpcMutate<{ ok: boolean; source: string }>("admin.queueSourcePause", { source }),
|
||||
queueSourceResume: (source: string) => trpcMutate<{ ok: boolean; source: string }>("admin.queueSourceResume", { source }),
|
||||
queueSourceStop: (source: string) => trpcMutate<{ ok: boolean; source: string; cleared: number }>("admin.queueSourceStop", { source }),
|
||||
queueSourceStart: (source: string) => trpcMutate<{ ok: boolean; source: string }>("admin.queueSourceStart", { source }),
|
||||
auditLog: (limit = 50, offset = 0, actor?: string, action?: string) =>
|
||||
trpcQuery<Array<{ id: string; actor: string; action: string; target: string | null; ts: string; meta: string | null }>>("admin.auditLog", { limit, offset, ...(actor ? { actor } : {}), ...(action ? { action } : {}) }),
|
||||
queueLint: (symbol: string, kind: 'sec-lint-holders' | 'sec-lint-insiders') =>
|
||||
@@ -1726,6 +1730,10 @@ export interface QueueStatus {
|
||||
lastErrors: Array<{ key: string; error: string | null }>;
|
||||
/** Active vendor cool-downs after 429 (ADR-0009). */
|
||||
sourceCooldowns?: SourceCooldown[];
|
||||
/** Operator-paused sources (drain frozen, jobs retained). */
|
||||
pausedSources?: string[];
|
||||
/** Operator-stopped sources (drain frozen, jobs cleared, enqueue blocked). */
|
||||
stoppedSources?: string[];
|
||||
}
|
||||
|
||||
export interface ScheduleEntry {
|
||||
|
||||
Reference in New Issue
Block a user