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:
+4
-1
@@ -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).
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user