RocketChat / Rocket.Chat.Apps-engine

The Rocket.Chat Apps engine and definitions.

Home Page:https://rocketchat.github.io/Rocket.Chat.Apps-engine/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Changes for scheduler task id & processor?

juzser opened this issue · comments

Hi guys,

I think the current logic for the Schedule and Processor is not fully correct.

Schedule processors can only be registered during the initialization of the app.
Currently, with one processor you can create many tasks, but with the cancelJob you have to pass the job's id, that means it will cancel all tasks of the processor.

So if many users create tasks, the tasks will be added to the queue and trigger the processor at the set time.
But if one user want to cancel all of his tasks, or one of his task, that's impossible. And by cancelling the task, he will cancel the tasks of all other users who using the same processor (cancel by id). Am I correct?

There is only one way to avoid this: create as many as the processors during the initialization and define the ids for them. But that's terrible 😅.

Solution

I think we should add a prop called processorId for the interface IOnetimeSchedule & IRecurringSchedule

What do you think?

Any idea for this?

Update here: #437
Waiting for this 👍🏽