Background jobs allow you to schedule parse server cloud code functions to be executed at periodic intervals. There is no limit on the number of times your background jobs execute. Background jobs execute in the same container as your app but on a different thread. Background jobs share CPU and Memory resources with your app. You can scale background jobs to multiple workers. Where multiple app containers are involved, the scheduler can also be instructed on the total number of your app containers to use for running a background job.
The below steps provide a guide to configure background jobs on NodeChef
status.success() or status.error() must be called in your code for the background process to exit. Not calling this function will result in a process leak which will eventually crash the app container.
After status.success() or status.error() is called, the background process running the job will exit immediately.
You can explicitly kill long running jobs from the dashboard. Navigate to App actions > Background Jobs > Jobs. Click on the name of the job and use the "try kill job" button.
Select the function to execute and use the 'Run Now' button to schedule the job for immediate execution.
For this use case, consider the job runs every day at 10am and the job has to be scheduled to start executing starting tomorrow. If the job was to start executing today and the time of the day is past 10am, the job will run immediately when scheduled.
For this use case, consider we want the job to run every of the week at 10am. If running on a specific day of the week is not a requirement you can simply select today's date under the First Run dropdown.