From 63baec35fefa2aa54d39d8c3d44f6e8f43111682 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Thu, 16 Jan 2025 15:02:04 +0100 Subject: [PATCH] Fix schedule trigger --- src/containers/job/JobManagerContainer.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/containers/job/JobManagerContainer.ts b/src/containers/job/JobManagerContainer.ts index afef2652..6ce3563f 100644 --- a/src/containers/job/JobManagerContainer.ts +++ b/src/containers/job/JobManagerContainer.ts @@ -184,9 +184,6 @@ export class JobManagerContainer extends Container { driveJobs.jobs.push(job); break; case 'run_action': - if (driveJobs.jobs.find(subJob => subJob.type === 'run_action' && notCompletedJob(subJob))) { - return; - } { const googleFileSystem = await this.filesService.getSubFileService(driveId, '/'); const userConfigService = new UserConfigService(googleFileSystem); @@ -765,6 +762,13 @@ export class JobManagerContainer extends Container { await this.runAction(driveId, currentJob.id, currentJob.action_id, currentJob.payload, currentJob.user); await this.clearGitCache(driveId); // TODO: check if necessary? + await this.schedule(driveId, { + ...initJob(), + type: 'run_action', + title: 'Run action:', + trigger: currentJob.action_id + }); + this.engine.emit(driveId, 'toasts:added', { title: 'Done: ' + currentJob.title, type: 'run_action:done', @@ -781,8 +785,6 @@ export class JobManagerContainer extends Container { payload: this.params.payload }); throw err; - } finally { - driveJobs.jobs = driveJobs.jobs.filter(removeOldByType('run_action')); } break; case 'git_fetch':