Use app config to disable background jobs and prevent them from running#40969
Use app config to disable background jobs and prevent them from running#40969
Conversation
|
Kudos, SonarCloud Quality Gate passed! |
|
Are these job IDs constant over time? |
|
As far as I know, there isn't a guarantee that the ids will remain constant, but they are incremental. New jobs will use the latest id available provided by the DB. |
|
I installed in my cloud and disabled some jobs: Lets wait and see |
|
Something looks weird, the job 25 does not appear anymore but the 10 is still there: |
|
Job 25 is likely an invalid job (I'm not finding the code for it in the master branch). By default, the |
PR #40846 released in 10.13.0 |
Seen while testing:
|








Description
Allow background jobs to be disabled via app config.
You can use
occ config:app:set backgroundjob jobs_disabled --value 19,5to disable the jobs with the id 19 and 5.The value for the key is a comma-separated list of job ids. The job ids can be checked with
occ background:queue:statusYou can use
occ config:app:delete backgroundjob jobs_disabledto remove the option set.Note that this only affects to the cron execution. You can still run the disabled jobs manually with
occ background:queue:execute <jobid>Furthermore, a disabled job that tried to run will have the "reserved_at" column filled. This means that you'll have to wait 12 hours for the next attempt to run the job even if it's removed from the disabled list.
Related Issue
https://github.com/owncloud/enterprise/issues/5978
Motivation and Context
This is intended to disable jobs that could use too many resources or take a lot of time, without removing them from the list. Note that all the background jobs should run unless there is a problem with them.
How Has This Been Tested?
In a fresh installation:
occ config:app:set backgroundjob jobs_disabled --value <jobid>occ system:cron. A warning log should appear for the job marked as disabled. "reserved_at" column in the DB is filled for the target job id.occ system:cronagain. Disabled job won't run until 12 hours have passed, so no new log message will be shown.Screenshots (if appropriate):
Types of changes
Checklist: