Skip to content

Commit

Permalink
Fix schedule trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
ggodlewski committed Jan 16, 2025
1 parent 7ee1115 commit 63baec3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/containers/job/JobManagerContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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',
Expand All @@ -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':
Expand Down

0 comments on commit 63baec3

Please sign in to comment.