summaryrefslogtreecommitdiffstats
path: root/lib/private/BackgroundJob/JobList.php
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2023-04-26 15:11:47 +0200
committerLouis Chemineau <louis@chmn.me>2023-05-03 10:39:38 +0200
commit8ad2f340453cade0bf0b37d02e5cdadf49381abb (patch)
tree920cd856d19889bd3079bb85d1597d64affbabb0 /lib/private/BackgroundJob/JobList.php
parentd95ccfd3ae125ad3fb0e9239bc4498b7fe51d8d1 (diff)
downloadnextcloud-server-8ad2f340453cade0bf0b37d02e5cdadf49381abb.tar.gz
nextcloud-server-8ad2f340453cade0bf0b37d02e5cdadf49381abb.zip
Remove job from oc_jobs when the file is not findable
When an application is disabled, or when a background jobs is removed by the app developer, then the job won't be found. In those cases, it makes sense to remove those jobs from oc_job. Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'lib/private/BackgroundJob/JobList.php')
-rw-r--r--lib/private/BackgroundJob/JobList.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/BackgroundJob/JobList.php b/lib/private/BackgroundJob/JobList.php
index fbeee1f56e9..3cdfee51138 100644
--- a/lib/private/BackgroundJob/JobList.php
+++ b/lib/private/BackgroundJob/JobList.php
@@ -307,7 +307,8 @@ class JobList implements IJobList {
$class = $row['class'];
$job = new $class();
} else {
- // job from disabled app or old version of an app, no need to do anything
+ // Remove job from disabled app or old version of an app
+ $this->removeById($row['id']);
return null;
}
}