aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/AppInfo
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-06-16 16:14:28 +0200
committerGitHub <noreply@github.com>2016-06-16 16:14:28 +0200
commit0b7685d326279fd822a161fb29c2256e2ad01c50 (patch)
tree2b7bcc952a5aa3338509df5bca87ae3a62344fa4 /apps/dav/lib/AppInfo
parentd6cf310dfc52b81a8f15981017721d88f7fb64ed (diff)
downloadnextcloud-server-0b7685d326279fd822a161fb29c2256e2ad01c50.tar.gz
nextcloud-server-0b7685d326279fd822a161fb29c2256e2ad01c50.zip
Move birthday calendar generation to a live migration job (#25135)
Diffstat (limited to 'apps/dav/lib/AppInfo')
-rw-r--r--apps/dav/lib/AppInfo/Application.php25
1 files changed, 11 insertions, 14 deletions
diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php
index 9e0d2da4e17..de2056ebc35 100644
--- a/apps/dav/lib/AppInfo/Application.php
+++ b/apps/dav/lib/AppInfo/Application.php
@@ -32,6 +32,7 @@ use OCA\DAV\Connector\Sabre\Principal;
use OCA\DAV\DAV\GroupPrincipalBackend;
use OCA\DAV\HookManager;
use OCA\DAV\Migration\Classification;
+use OCA\DAV\Migration\GenerateBirthdays;
use \OCP\AppFramework\App;
use OCP\AppFramework\IAppContainer;
use OCP\Contacts\IManager;
@@ -116,6 +117,16 @@ class Application extends App {
$c->getServer()->getUserManager()
);
});
+
+ $container->registerService('OCA\DAV\Migration\GenerateBirthdays', function ($c) {
+ /** @var IAppContainer $c */
+ /** @var BirthdayService $b */
+ $b = $c->query('BirthdayService');
+ return new GenerateBirthdays(
+ $b,
+ $c->getServer()->getUserManager()
+ );
+ });
}
/**
@@ -164,18 +175,4 @@ class Application extends App {
return $this->getContainer()->query('SyncService');
}
- public function generateBirthdays() {
- try {
- /** @var BirthdayService $migration */
- $migration = $this->getContainer()->query('BirthdayService');
- $userManager = $this->getContainer()->getServer()->getUserManager();
-
- $userManager->callForAllUsers(function($user) use($migration) {
- /** @var IUser $user */
- $migration->syncUser($user->getUID());
- });
- } catch (\Exception $ex) {
- $this->getContainer()->getServer()->getLogger()->logException($ex);
- }
- }
}