I have setup cron ,however it is not working, below is code:

{
“jobs” : [{
“functionLocation” : “/data.js” ,
“functionName” : “save” ,
“description” : “Save Data to database” ,
“executionConfig” : {
“time” : “* * * * *”
}
}]
}
and by data.js file is as below
import wixData from ‘wix-data’ ;

export function save() {
let toSave = {
“firstName” : “John” ,
"lastName " : “Doe”
};

wixData.save( "Contact" , toSave); 

}
kindly suggest as I have just checked several post but could not help unfortunately

Hi, I have tried to implement your code in my site using this job config and its seems working,
{
“jobs” : [
{
“functionLocation” : “/data.js” ,
“functionName” : “save” ,
“description” : “Save Data to database” ,
“executionConfig” : {
“time” : “08:05”
}
}]
}

I suggest to open the stackdriver monitor and send us the error you get there.
https://support.wix.com/en/article/corvid-about-site-monitoring

Best,
Sapir

Hi I get following error “2020-05-18 15:19:37.387 ISTFailed to parse job configuration for site ‘mysite-2’: executionConfig.time: * * * * * is of unexpected format of hh:mm”

I think I need to use cronExpression insted of time

However changing time to cronExpression I am getting following error 2020-05-18 15:25:33.232 ISTFailed to parse job configuration for site ‘mysite-2’: The interval is above 1 hours

Hi,

The format time supposed to be as I sent above (pay attention that its string and not num) and the time is according UTC,
Can you send the URL to your site so we can inspect?

Best,
Sapir