How to detect when a queued job finished? #112
-
|
Job class has a state property but seems there's no way to be notified when its value changes. Any ideas how to accomplish this? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
|
A way to implement this feature is triggering events similar to bullmq QueueEvents The way i see, is adding a on(state: JobState | JobState[], listener: (JobData) => void): void {
}For more granular and aligned to on(state: JobState | JobState[], params: { queue?: string | string[]; jobClass?: string | string[]}, listener: (JobData) => void): void {
} |
Beta Was this translation helpful? Give feedback.
-
|
No, there is no way of notifying when a job finishes. We have this feature in our roadmap, and probably only on Sidequest pro. But this is a good issue for OSS as well. I will talk to @merencia about it. Maybe we will add this to OSS. |
Beta Was this translation helpful? Give feedback.
-
|
+1 for this, I would like to know when a job is finished, and in what state (finished due to error and no more retries). |
Beta Was this translation helpful? Give feedback.
-
|
@drewbaker as of now, the only way of doing that is to poll the job by ID and watch its state. |
Beta Was this translation helpful? Give feedback.
No, there is no way of notifying when a job finishes. We have this feature in our roadmap, and probably only on Sidequest pro. But this is a good issue for OSS as well. I will talk to @merencia about it. Maybe we will add this to OSS.