summaryrefslogtreecommitdiffstats
path: root/apps/dav/appinfo
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2018-06-18 18:15:50 +0200
committerGeorg Ehrke <developer@georgehrke.com>2018-06-25 04:59:01 +0200
commit8f061f5407a3c1c0286b08851ab6740b52a20964 (patch)
treed3ad852025f4a86fa212959bb565b81996e292aa /apps/dav/appinfo
parent9aca92c441229619cfef5ee4dc68f71d819bc6e9 (diff)
downloadnextcloud-server-8f061f5407a3c1c0286b08851ab6740b52a20964.tar.gz
nextcloud-server-8f061f5407a3c1c0286b08851ab6740b52a20964.zip
periodically query calendar resource / room backends for updated resource / room information
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/dav/appinfo')
-rw-r--r--apps/dav/appinfo/app.php13
-rw-r--r--apps/dav/appinfo/info.xml1
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>