aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Richards <josh.t.richards@gmail.com>2025-02-06 11:14:54 -0500
committerJosh Richards <josh.t.richards@gmail.com>2025-02-06 11:14:54 -0500
commitc5257fed1ac07a588cf80da6456827bc9a46b46e (patch)
treec459714849f7d1b0a8111f478917e8ac33412ce3
parentf9c03f760653c4293cbf29560e1cacbd3cf8a997 (diff)
downloadnextcloud-server-fix-jobs-app-disable.tar.gz
nextcloud-server-fix-jobs-app-disable.zip
fix(apps): Remove jobs when an app gets disabledfix-jobs-app-disable
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
-rw-r--r--lib/private/App/AppManager.php1
-rw-r--r--lib/private/legacy/OC_App.php7
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php
index b6f7f9b13b7..0dd0d1f6b33 100644
--- a/lib/private/App/AppManager.php
+++ b/lib/private/App/AppManager.php
@@ -672,6 +672,7 @@ class AppManager implements IAppManager {
$appData = $this->getAppInfo($appId);
if (!is_null($appData)) {
\OC_App::executeRepairSteps($appId, $appData['repair-steps']['uninstall']);
+ \OC_App::removeBackgroundJobs($appData['background-jobs']);
}
$this->dispatcher->dispatchTyped(new AppDisableEvent($appId));
diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php
index 544938b6ff9..78fd1e60844 100644
--- a/lib/private/legacy/OC_App.php
+++ b/lib/private/legacy/OC_App.php
@@ -755,6 +755,13 @@ class OC_App {
$r->run();
}
+ public static function removeBackgroundJobs(array $jobs) {
+ $queue = \OC::$server->getJobList();
+ foreach ($jobs as $job) {
+ $queue->remove($job);
+ }
+ }
+
public static function setupBackgroundJobs(array $jobs) {
$queue = \OC::$server->getJobList();
foreach ($jobs as $job) {