-
I need to sync my db with bull a bit to track jobs, but while doing that i noticed that Is that a bug in documentation, or there is a edge-case when worker can actually get a job without one? I can see that it actually doesn't have one before scheduler creates it, but that coming into Worker type-def sounds a bit silly P.S. not a dealbraker or anything - I still can pass it as part of the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The reason is that a job does not get an id until it is stored in Redis... maybe there were more elegant ways to design this API, but I think it is difficult to change it now without a breaking change. |
Beta Was this translation helpful? Give feedback.
I think in that case what we can do is add a type guard to the process function where we know the id is present:
Job & { id: string }