I’m building an API that the data get updated every day at 11 pm as well send multiple notifications using the cronjob.
I’m facing a weird problem that the cronjob works if their requests and the server get busy, but when not and no requests the server more like get shut down!!
This causes other issues too, like big loading time when the server not getting any requests for a while then with the first request it gets took like 14s!!!
Also, I have some endpoints supposed to get cached for 24H, because of that issue, all cached get wiped out of sudden!!
I installed the nodeJS app from the nodejs start applications in cpanel on my host!
2
Answers
Could it be that you need a “persistent” NodeJS app to have it avilable all the time?
See this https://www.a2hosting.com/kb/developer-corner/making-persistent-node.js-applications
myLock is typically on A2 something like..
./nodevenv/[yourAppUrl]/.lock