]> source.dussan.org Git - nextcloud-server.git/commitdiff
Remove job from oc_jobs when the file is not findable 37937/head
authorLouis Chemineau <louis@chmn.me>
Wed, 26 Apr 2023 13:11:47 +0000 (15:11 +0200)
committerLouis Chemineau <louis@chmn.me>
Wed, 3 May 2023 08:39:38 +0000 (10:39 +0200)
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>
lib/private/BackgroundJob/JobList.php

index fbeee1f56e94c9018a277e07bc59862fe319a195..3cdfee5113890b5c27e1bacb5e45e0824ebc9874 100644 (file)
@@ -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;
                                }
                        }