I testing how cron job works and updating an item in my collection but it doesn’t seem to work. I tried running it in the hour and checked the database collection. It didn’t update.
Your code is mixing sync and async functions. Have you tried to run this function from a dummy-page with a button, to see if the function actually works?
Hi Giri, thanks for the reply.
the function updateUserData seems to run when I tested in the backend.
The collection.
The function I’m running, there was a typo so I changed it.
I ran it in the backend and it updated my collection. Are you saying I should remove the async since it’s for the cron job?
Hi,
just for test:
- remove the latest empy {}
- put a fixed hour to run the job
“executionConfig” : {
“time” : “00:10”
}- remember to cancel the “,” before the closing ]
Server running hour could be different from your local time zone.
No, you do not have to kill anything, I just wanted to know if the function ran at all. Now, check your config job at https://shoonia.github.io/jobs.config/#validator
Then, if it still does not work, look at the backend logs. Since half a year or so, it also contains errors from a Scheduled Job
Thanks again for the reply!
I ran in the validator and it gave error on the first index.
I tried removing the async and the exports and there’s always an error on position 0.
Where can I see the backend logs?
@ebengco No, no, it’s not a code validator, it’s for the config of the scheduled job, the JSON.
And for backend los, see site monitor.
@giri-zano thanks again, I put the config in there, I had to clean it up and remove the comment codes and it gave a valid config. I believe the code ran today but I will test again tonight!
Thank you!
Actually, it didn’t ran at all I checked the site logs and it wasn’t there.