Skip to content

Commit c5257fe

Browse files
committed
fix(apps): Remove jobs when an app gets disabled
Signed-off-by: Josh Richards <[email protected]>
1 parent f9c03f7 commit c5257fe

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/private/App/AppManager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,7 @@ public function disableApp($appId, $automaticDisabled = false): void {
672672
$appData = $this->getAppInfo($appId);
673673
if (!is_null($appData)) {
674674
\OC_App::executeRepairSteps($appId, $appData['repair-steps']['uninstall']);
675+
\OC_App::removeBackgroundJobs($appData['background-jobs']);
675676
}
676677

677678
$this->dispatcher->dispatchTyped(new AppDisableEvent($appId));

lib/private/legacy/OC_App.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,13 @@ public static function executeRepairSteps(string $appId, array $steps) {
755755
$r->run();
756756
}
757757

758+
public static function removeBackgroundJobs(array $jobs) {
759+
$queue = \OC::$server->getJobList();
760+
foreach ($jobs as $job) {
761+
$queue->remove($job);
762+
}
763+
}
764+
758765
public static function setupBackgroundJobs(array $jobs) {
759766
$queue = \OC::$server->getJobList();
760767
foreach ($jobs as $job) {

0 commit comments

Comments
 (0)