mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-05-11 06:11:15 +00:00
Fix worker stuck on "Working..." and default channels to disabled
1. Worker trigger: Add ingestion_trigger pg_notify listener so the worker picks up on-demand triggers from the UI and runs an immediate cycle with full activity tracking (currentActivity, currentStep, etc). 2. Remove orphaned IngestionRun creation from triggerIngestion server action. Previously the UI created RUNNING runs without activity fields, causing the UI to show "Working..." with no details. Now only the worker creates runs with proper activity tracking. 3. Default channels to disabled (isActive: false) in schema and all creation paths. Destination channels are explicitly set to active since they must receive uploads. Includes Prisma migration. Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
This commit is contained in:
@@ -105,6 +105,19 @@ export async function startScheduler(): Promise<void> {
|
||||
scheduleNext();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger an immediate ingestion cycle (e.g. from the admin UI).
|
||||
* If a cycle is already running, this is a no-op.
|
||||
*/
|
||||
export async function triggerImmediateCycle(): Promise<void> {
|
||||
if (running) {
|
||||
log.info("Cycle already running, ignoring trigger");
|
||||
return;
|
||||
}
|
||||
log.info("Immediate cycle triggered via UI");
|
||||
await runCycle();
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the scheduler gracefully.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user