Job Scheduler: Scheduled Job Not Running

I have a scheduled job that is not running. I thought I set it up correctly. But, no matter what I try, it does not run. Help!

The code is in a folder in the backend called “RescueGroups” and in a file called “UpdateRescueGroups.js”

The function is called UpdateRescueGroups()

I have the job configured like this:

Yet, the function UpdateRescueGroups() never gets triggered. What am I doing wrong?

The code runs perfectly when I trigger it manually. So it seems that the job scheduler is simply not triggering it to run. I am in Central Time Zone (UTC -6). I keep resetting the time to 30 minutes into the future to see if it will run and then waiting till after it should have run and it is clear it has not. I have also tried watching the site monitor while it should be running and it does not seem to be at all.

Have you seen the info for it already?
https://www.wix.com/corvid/forum/corvid-tips-and-updates/new-feature-job-scheduler
https://www.wix.com/corvid/forum/corvid-tips-and-updates/video-how-to-execute-timed-tasks-with-the-job-scheduler
https://support.wix.com/en/article/corvid-scheduling-recurring-jobs

Yes. That is where I got the information for setting up the scheduled job.

@mike70099
Did you see Alex’s little tool at the end of the forum post for job setups?
https://shoonia.github.io/jobs.config/

Also, note that the time string is set as UTC time.

time (String)

The time of day the job runs. The time is specified as UTC time in HH:MM format.

So, as you state that you are on Central Time Zone (UTC -6), have you just simply checked to see if it is actually running at that time when it is converted to UTC time and not your own time?

Finally, you have set no day of week as you are wanting it to run the job daily at 2am in the morning, however can you add a weekday just to see if it does run on that day and at UTC time and not your own time zone.

You might have to check your time and change it to suit as 2am UTC in the morning of the next day will be 9pm still in the previous day your time, whereas 2am in the morning for your time will be 7am in the morning for UTC.

@givemeawhisky I have been trying all different times. I have not tried specifying a day of the week. I guess I can try that next. And, yes, as I said in my original post, I am adjusting for UTC time. I have even changed the first line of code to simply be a Wixdata.insert() into an activity log to check to see if the procedure ever runs and it does not. The code is simply never being triggered. I can leave it sit for 24 hours and it never runs. I had it set for 3 PM Central and left it for a few hours. Just got home. It is now 3 51 PM and it did not run at the 3 PM time here. I have not seen the specific link you provided above. I will check it out.

@givemeawhisky I checked out the link you provided and entered my file name, etc. and it generated identical code to what I have already used. No luck. I set it to be triggered at 4 PM my time and sat and watched the Site Monitor and no event were generated. No errors shown. No condole.log() generated. Nothing. The code did not trigger.

To make sure I was not being dyslexic about the timezone difference I even looked up the current correct UTC time and advanced it to the next hour. The only other thing I can think to try is specifying a day of the week to see if that will trigger. If it works, I guess I can create 7 jobs, one for each day. But, I’m skeptical that is the issue. The day and month settings are supposed to be optional and I have seen examples people say are working that do not use them.

@givemeawhisky SOLVED! I simply moved my code into a .jsw file instead of the .js file and it ran just fine.

@mike70099 can I utilize this for a Schedule Video Function?

@james-rondon-jr I’m not exactly sure what you mean by “scheduled video function.” The job scheduler is generally for backend functions that are not associated with user interface elements. They are things that run server-side in the background. You can automate the collection and storage of videos, pictures and things using the job scheduler. But, you would not likely use it to schedule a video event involving users.

@mike70099 basically what YT has, you can schedule videos when you are about to upload a video or you can choose to publish it right away, also I have a database and video uploader already set up.

@mike70099
Yes it shows jsw in the actual video tutorial whereas the written tutorial says you use js.

Video Tutorial

Written tutorial.

functionLocation (String)

The location of the backend function that will run at the scheduled time. The function can be any function in any backend .js file.

However, it seems that you can only use jsw for it, or at least maybe for certain functions.

Either that or Wix have messed up on the written tutorial and it should actually be jsw and not js.

@givemeawhisky Yup. Part of the pain of using a new feature.