Can I use .web.js files in Wix scheduled recurring jobs?

Is this way right syntax to call function from web.js file in the job config?

            "functionLocation": "/totalstudytime.web", 
            "functionName": "updateWeeklyStudyReport",
            "description": "Clear the daliystudytime and update it to the current date of the studytime Function field daily at 12 PM UTC",```
1 Like

Hi, @Aquarius_Mike !!

Since web.js is basically designed to be called from the frontend, I think it’s better to write jobs in a regular backend-only .js file. :slightly_smiling_face:

I personally prefer writing them as .web.js at the end.

Also - this tool I’m a huge fan of - Jobs Config | Velo by Wix - it’s amazing at helping put together scheduled jobs

1 Like

Yeah, I considered about that before, but my function is too complex, and it has permission limitation, that’s why I choose web method

1 Like

All right Sir, I’ll test it out! :grin:

1 Like

Solution Found! Web Method don’t work as usual. I guess that’s because of new module format and permission parameter. normal backend .js works

1 Like

Yes, since the job is completed on the backend, I think a regular backend .js file should be sufficient. :innocent: I think there’s also a security benefit to not mixing things that might be called from the frontend with those that definitely won’t. :upside_down_face:

2 Likes