diff options
Diffstat (limited to 'apps/dav/appinfo')
-rw-r--r-- | apps/dav/appinfo/app.php | 13 | ||||
-rw-r--r-- | apps/dav/appinfo/info.xml | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/apps/dav/appinfo/app.php b/apps/dav/appinfo/app.php index 4f4fbe6e126..5c08bc7e0b5 100644 --- a/apps/dav/appinfo/app.php +++ b/apps/dav/appinfo/app.php @@ -48,6 +48,19 @@ $eventDispatcher->addListener('OCP\Federation\TrustedServerEvent::remove', } ); +$eventHandler = function() use ($app) { + try { + $job = $app->getContainer()->query(\OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob::class); + $job->run(); + $app->getContainer()->getServer()->getJobList()->setLastRun($job); + } catch(\Exception $ex) { + $app->getContainer()->getServer()->getLogger()->logException($ex); + } +}; + +$eventDispatcher->addListener('\OCP\Calendar\Resource\ForceRefreshEvent', $eventHandler); +$eventDispatcher->addListener('\OCP\Calendar\Room\ForceRefreshEvent', $eventHandler); + $cm = \OC::$server->getContactsManager(); $cm->register(function() use ($cm, $app) { $user = \OC::$server->getUserSession()->getUser(); diff --git a/apps/dav/appinfo/info.xml b/apps/dav/appinfo/info.xml index 96452493f92..d1f9a823fd7 100644 --- a/apps/dav/appinfo/info.xml +++ b/apps/dav/appinfo/info.xml @@ -21,6 +21,7 @@ <background-jobs> <job>OCA\DAV\BackgroundJob\CleanupDirectLinksJob</job> + <job>OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob</job> </background-jobs> <repair-steps> |