Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upIf QueueEventsOptions lastEventId is not set to `$`, it replays the full (all-time) event history on process restart #76
Comments
This comment has been minimized.
This comment has been minimized.
Hmm, I thought we've already replaced |
This comment has been minimized.
This comment has been minimized.
@stansv https://github.com/taskforcesh/bullmq/blob/master/src/classes/queue-events.ts#L29 is update: I found bullmq/src/classes/queue-scheduler.ts Line 92 in 7eae653 In my use case, replaying those events immediately in a loop on process restart actually blocks a server from binding to a port until those hundred events have been processed. It's probably a different Issue that event processing should be on a setTimeout(,0)/setImmediate/process.nextTick, not in a blocking loop in |
This comment has been minimized.
This comment has been minimized.
Would a PR that uses XREADGROUP be welcome? |
This comment has been minimized.
This comment has been minimized.
@jbr the code above regarding XTRIM is for internal delayed jobs events, 100 is a extremely safe value so that we do not need to rely on watchdogs as we had in Bull3. Regarding QueueEVents, the workaround is to pass '$' to only receive new events. I thought I had changed that already but for some reason is not the default value yet. |
Possible solutions:
"$"
instead of"0-0"
, only streaming new events. Downside of this approach: Events are ignored during QueueEvents listener unavailability