mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
fix(apps): Remove jobs when an app gets disabled
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
This commit is contained in:
parent
f9c03f7606
commit
c5257fed1a
2 changed files with 8 additions and 0 deletions
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue