I have created jobs that I would like to run hourly.
The function “GetDataFromDataBase” is known to run correctly and will run when triggered by a routerRequest page. It is an external call to an API to receive employee data to sync with Wix.
The execution time is minimal.
So why wont it work as a job?
Are there any known limits to a job that will not allow external calls?
Can you not have the same call more than once a day?
// /backend/jobs.config
{
“jobs”: [
{
“functionLocation”: “/WixToEmp.GetDataFromDataBase”,
“description”: “Retrieve Employee Data”,
“executionConfig”: {
“time”: “12:00”
}
},
{
“functionLocation”: “/WixToEmp.GetDataFromDataBase”,
“description”: “Retrieve Employee Data”,
“executionConfig”: {
“time”: “13:00”
}
}
]
}
Just having a quick glance at the Wix Support page for it.
https://support.wix.com/en/article/corvid-scheduling-recurring-jobs
It does look like you can only either set it for a set time and have it run daily, weekly or monthly.
As you have put in the time, then it will run daily at that time only.
- For daily jobs, the “executionConfig” object only contains the “time” property.
Have you tried simply adding hourly times to the time to see if it will accept multiple times and not just limited to the one set time only? It probably won’t work, but worth a try anyway.
Watch the Wix Youtube video for it too.
https://www.youtube.com/watch?v=l9r2SIvKnBM
Finally, remember that you must publish your site to save changes to your jobs configuration.
Thank you for your thoughts. I have been down the links you are referring too. I was not able to glean the information that would help solve the issues. I see that the first example points to a JS file but others tutorials point at JSW files. I will give that a try next.