Skip to content

Commit

Permalink
[FIX][APPS] Scheduler duplicating recurrent tasks after server restart (
Browse files Browse the repository at this point in the history
#21866)

Co-authored-by: Douglas Gubert <douglas.gubert@gmail.com>
  • Loading branch information
thassiov and d-gubert authored Apr 29, 2021
1 parent f8171f4 commit ad8756a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/apps/server/bridges/scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ export class AppSchedulerBridge {
this.orch.debugLog(`The App ${ appId } is scheduling a recurring job`, id);
try {
await this.startScheduler();
const job = this.scheduler.create(id, data || {});
job.repeatEvery(interval, { skipImmediate });
await job.save();
await this.scheduler.every(interval, id, data || {}, { skipImmediate });
} catch (e) {
this.orch.getRocketChatLogger().error(e);
}
Expand Down

0 comments on commit ad8756a

Please sign in to comment.