feat: picdrop delivery — worker delivers on job completion, /api/deliver for manual, gallery default 'POSTER LEA', library bulk send + status badges

This commit is contained in:
2026-07-23 15:41:04 +00:00
parent 25d0a5cd97
commit 26c3e0ef07
4 changed files with 81 additions and 3 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
import { one, query } from './lib/db';
import { startWorker, type GenerateJob } from './lib/queue';
import { processItem } from './lib/process';
import { deliverPendingForJob } from './lib/delivery';
/** Startet den Warteschlangen-Arbeiter (im selben Node-Prozess wie die App). */
export async function startImageWorker(): Promise<void> {
@@ -53,6 +54,8 @@ async function maybeComplete(jobId: string): Promise<void> {
if (row && row.open === 0) {
await query(`UPDATE jobs SET status='done', finished_at=now() WHERE id=$1 AND status<>'cancelled'`,
[jobId]);
// TODO: Auslieferung (Picdrop) + Benachrichtigung (Telegram/n8n) anstoßen.
// Picdrop-Auslieferung für alle offenen Positionen anstoßen.
try { await deliverPendingForJob(jobId); } catch (e) { console.error('[worker] Auslieferung:', e); }
// TODO: Benachrichtigung (Telegram/n8n).
}
}