]> source.dussan.org Git - nextcloud-server.git/commitdiff
avoids users searches on backend, faster processing
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Wed, 17 Apr 2019 11:40:48 +0000 (13:40 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Wed, 17 Apr 2019 13:55:23 +0000 (15:55 +0200)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
apps/dav/lib/CardDAV/SyncService.php
apps/dav/lib/Command/SyncBirthdayCalendar.php
apps/dav/lib/Controller/BirthdayCalendarController.php
apps/dav/lib/Migration/RegenerateBirthdayCalendars.php

index 6f6fa0ba379e313dcf4ae045478cc31dd16a1433..4a713daeba0b494869cc091c6ea00bfa14eaba90 100644 (file)
@@ -319,7 +319,7 @@ class SyncService {
 
        public function syncInstance(\Closure $progressCallback = null) {
                $systemAddressBook = $this->getLocalSystemAddressBook();
-               $this->userManager->callForAllUsers(function($user) use ($systemAddressBook, $progressCallback) {
+               $this->userManager->callForSeenUsers(function($user) use ($systemAddressBook, $progressCallback) {
                        $this->updateUser($user);
                        if (!is_null($progressCallback)) {
                                $progressCallback();
index 88f85a98812784645adb4b1d1cd4ea1a980fd755..3d1bcab6c31628f8553d6db4eeaca1ee9328895a 100644 (file)
@@ -92,7 +92,7 @@ class SyncBirthdayCalendar extends Command {
                $output->writeln("Start birthday calendar sync for all users ...");
                $p = new ProgressBar($output);
                $p->start();
-               $this->userManager->callForAllUsers(function($user) use ($p)  {
+               $this->userManager->callForSeenUsers(function($user) use ($p)  {
                        $p->advance();
 
                        $userId = $user->getUID();
index 244111e3aec41dc450b2fa81c42c9ea09ac70aad..4964de0b216c51b3f9013133d26c183d463b0eaf 100644 (file)
@@ -93,7 +93,7 @@ class BirthdayCalendarController extends Controller {
                $this->config->setAppValue($this->appName, 'generateBirthdayCalendar', 'yes');
 
                // add background job for each user
-               $this->userManager->callForAllUsers(function(IUser $user) {
+               $this->userManager->callForSeenUsers(function(IUser $user) {
                        $this->jobList->add(GenerateBirthdayCalendarBackgroundJob::class, [
                                'userId' => $user->getUID(),
                        ]);
index 2c2b4eb0e9ac13c3e40b2ae1b28faa87180bd44e..263e6d00db460efca6d1fef4193236c917cadd70 100644 (file)
@@ -72,7 +72,7 @@ class RegenerateBirthdayCalendars implements IRepairStep {
                }
 
                $output->info('Adding background jobs to regenerate birthday calendar');
-               $this->userManager->callForAllUsers(function(IUser $user) {
+               $this->userManager->callForSeenUsers(function(IUser $user) {
                        $this->jobList->add(GenerateBirthdayCalendarBackgroundJob::class, [
                                'userId' => $user->getUID(),
                                'purgeBeforeGenerating' => true
@@ -82,4 +82,4 @@ class RegenerateBirthdayCalendars implements IRepairStep {
                // if all were done, no need to redo the repair during next upgrade
                $this->config->setAppValue('dav', 'regeneratedBirthdayCalendarsForYearFix', 'yes');
        }
-}
\ No newline at end of file
+}