Allow Run Now on paused routines
The server rejected manual runs for any non-active routine. Now only archived routines are blocked — paused routines can still be triggered manually via "Run now". Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
21765f8118
commit
c7d05096ab
1 changed files with 1 additions and 1 deletions
|
|
@ -885,7 +885,7 @@ export function routineService(db: Db) {
|
|||
runRoutine: async (id: string, input: RunRoutine) => {
|
||||
const routine = await getRoutineById(id);
|
||||
if (!routine) throw notFound("Routine not found");
|
||||
if (routine.status !== "active") throw conflict("Routine is not active");
|
||||
if (routine.status === "archived") throw conflict("Routine is archived");
|
||||
const trigger = input.triggerId ? await getTriggerById(input.triggerId) : null;
|
||||
if (trigger && trigger.routineId !== routine.id) throw forbidden("Trigger does not belong to routine");
|
||||
if (trigger && !trigger.enabled) throw conflict("Routine trigger is not active");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue