node-cron
node-cron copied to clipboard
Cron job got executed twice on Azure Web App
Hi all,
My cron job gets executed twice on my azure web app.
Even a simple console.log('hi'), gets executed twice. Anyone knows what this could be?
Kind regards, Brecht
Maybe you have 2 instances?
Have you resolved this issue @brechtarnou . I am also facing the same issue on AWS.
Maybe you have 2 instances?
I am also facing the same. On local server this is working perfectly, but after deploying on AWS the cron triggering twice . I have multiple crons running in the project and each cron is running twice. DON'T know how to resolve this
@NareshKukreti12 @brechtarnou not sure if you are still facing this issue. I recently ran into this after deploying app to Azure web and resolved the problem by fixing the number of instances - inspired by @davidlane-iteratec's comment. In my case, turned out that the app had been set to default to 5 instances constantly. Reducing to one instance stopped the issue immediately.
Alternatively, if you prefer to keep >1 instance for performance optimization, try leveraging autoscale to dynamically control the number of instances - this has effectively resolved the issue for me
Might be something similar on AWS? @NareshKukreti12