Rocket.Chat.Apps-engine icon indicating copy to clipboard operation
Rocket.Chat.Apps-engine copied to clipboard

[FIX] schedular.cancelJob() being async due to a broken promise

Open murtaza98 opened this issue 3 years ago • 0 comments

What? :boat:

Why? :thinking:

if we either use cancelJob or cancelAllJobs method of ISchedulerModify, the operation runs asynchronously due to which there is no way for apps to know if the operation was completed. This PR attempts to fix this

Sample code:

await configurationModify.scheduler.cancelJob(
				JobId.JOBS_RESTART_JOB,
);

Note: even with the await above, it still runs asynchronously :grimacing:

Links :earth_americas:

PS :eyes:

murtaza98 avatar Aug 30 '22 11:08 murtaza98