feat: Webhook-Warteschlange für sequenzielle, deduplizierte Verarbeitung
Build and Push Multi-Platform Images / build-and-push (push) Successful in 37s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 37s
Der Webhook reiht eingehende Dokument-IDs nur noch in eine Warteschlange ein und antwortet sofort (status "queued"). Ein separater Intervall-Prozess (WebhookQueueService) arbeitet die IDs nacheinander ab – ohne Überschneidung, falls ein Dokument mehrfach kurz hintereinander gespeichert wird: - Jede ID kommt nur einmal in der Liste vor (Dedup). - Beim Verarbeitungsstart wird die ID sofort entfernt; ein erneutes Feuern während der Verarbeitung reiht sie wieder ein (ein weiterer Lauf folgt). - Es läuft immer nur eine Verarbeitung gleichzeitig (isProcessing-Guard). - Prüfintervall sehr kurz (WEBHOOK_QUEUE_INTERVAL_MS, Default 1000 ms). Status-Recording (last_webhook_call) + GET /api/webhook/status wandern in den Queue-Service und liefern zusätzlich die aktuelle Warteschlangen-Größe. Frontend-Tab zeigt Status "In Warteschlange" und die Queue-Größe an. Unit-Test deckt Dedup, Remove-on-start, Re-Enqueue und No-Parallel ab. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
b77a283ab2
commit
66a2cccd20
6 files changed
+299
-106
No files matched your search
@@ -4,13 +4,14 @@ export interface WebhookLastCall {
|
||||
at: string; // ISO-Zeitstempel
|
||||
documentId: number | null;
|
||||
action: string | null;
|
||||
status: 'processed' | 'skipped' | 'error' | 'bad-request' | string;
|
||||
status: 'queued' | 'processed' | 'error' | 'bad-request' | string;
|
||||
reason?: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface WebhookStatus {
|
||||
lastCall: WebhookLastCall | null;
|
||||
queueSize?: number;
|
||||
}
|
||||
|
||||
export const webhookApi = {
|
||||
|
||||
Reference in new issue
Block a user