Skip to content

Commit

Permalink
fix: fixed DbxFirebaseDevelopmentSchedulerService error handling
Browse files Browse the repository at this point in the history
- fixed issue where error would be cleared every time the scheduled tasks ran regardless of whether or not an error occurred
  • Loading branch information
dereekb committed Oct 9, 2022
1 parent 5ceec11 commit 3763fdf
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,19 @@ export class DbxFirebaseDevelopmentSchedulerService implements Initialized {
exhaustMap(() => {
console.log('Running scheduled tasks in order... ', executionOrder);

return PromiseUtility.runTasksForValues(executionOrder, (taskName) => this.runScheduledFunction(taskName), { sequential: true, retriesAllowed: 0, retryWait: 0 }).catch((e) => {
console.log('Failed running scheduled task: ', e);
this._error.next(true);
});
return PromiseUtility.runTasksForValues(executionOrder, (taskName) => this.runScheduledFunction(taskName), { sequential: true, retriesAllowed: 0, retryWait: 0 })
.then(() => true)
.catch((e) => {
console.log('Failed running scheduled task: ', e);
this._error.next(true);
return false;
});
}),
tap(() => {
console.log('Successfully finished running all scheduled tasks.');
this._error.next(false);
tap((success) => {
if (success) {
console.log('Successfully finished running all scheduled tasks.');
this._error.next(false);
}
})
);
})
Expand Down

0 comments on commit 3763fdf

Please sign in to comment.