Confusion on which part of code is being executed on repeated job #2500
Replies: 2 comments 7 replies
-
It is difficult to know what is going on as you post several moving parts. I recommend you write some simpler testable code and then build up from there. |
Beta Was this translation helpful? Give feedback.
-
@manast ok sorry I didn't describe it well. I am developing SMPP related application using sveltekit and I am using bullmq to execute I have implemented the above code inside
That's is the whole idea. Here is the full implemented code
|
Beta Was this translation helpful? Give feedback.
-
Hello friends I am having some logical issues here on my code, my application repeatedly sends SMS to client each day at some scheduled time. But on the next call of the function inside the worker, it first shows that the job is completed (before it get started) and then some functions get executed before the others. Here is the code I am working on,
Now I want to process cleaning the database before the main sending function starts but that's not happening.
The first thing being shown on each day at the scheduled time is,
console.log(
${job.name} is completed!)
from on complete event handler, and then it goes toconnectSMSC
function which should be called aftercleanupdb
function, as a result I am not getting what I was expecting on the flow of the application.I appreciate your support guys.
Beta Was this translation helpful? Give feedback.
All reactions