avoids users searches on backend, faster processing

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2019-04-17 13:40:48 +02:00 committed by Backportbot
parent fd42be531c
commit 847dfb0eb8
4 changed files with 5 additions and 5 deletions

View File

@ -319,7 +319,7 @@ class SyncService {
public function syncInstance(\Closure $progressCallback = null) { public function syncInstance(\Closure $progressCallback = null) {
$systemAddressBook = $this->getLocalSystemAddressBook(); $systemAddressBook = $this->getLocalSystemAddressBook();
$this->userManager->callForAllUsers(function($user) use ($systemAddressBook, $progressCallback) { $this->userManager->callForSeenUsers(function($user) use ($systemAddressBook, $progressCallback) {
$this->updateUser($user); $this->updateUser($user);
if (!is_null($progressCallback)) { if (!is_null($progressCallback)) {
$progressCallback(); $progressCallback();

View File

@ -92,7 +92,7 @@ class SyncBirthdayCalendar extends Command {
$output->writeln("Start birthday calendar sync for all users ..."); $output->writeln("Start birthday calendar sync for all users ...");
$p = new ProgressBar($output); $p = new ProgressBar($output);
$p->start(); $p->start();
$this->userManager->callForAllUsers(function($user) use ($p) { $this->userManager->callForSeenUsers(function($user) use ($p) {
$p->advance(); $p->advance();
$userId = $user->getUID(); $userId = $user->getUID();

View File

@ -93,7 +93,7 @@ class BirthdayCalendarController extends Controller {
$this->config->setAppValue($this->appName, 'generateBirthdayCalendar', 'yes'); $this->config->setAppValue($this->appName, 'generateBirthdayCalendar', 'yes');
// add background job for each user // add background job for each user
$this->userManager->callForAllUsers(function(IUser $user) { $this->userManager->callForSeenUsers(function(IUser $user) {
$this->jobList->add(GenerateBirthdayCalendarBackgroundJob::class, [ $this->jobList->add(GenerateBirthdayCalendarBackgroundJob::class, [
'userId' => $user->getUID(), 'userId' => $user->getUID(),
]); ]);

View File

@ -72,7 +72,7 @@ class RegenerateBirthdayCalendars implements IRepairStep {
} }
$output->info('Adding background jobs to regenerate birthday calendar'); $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, [ $this->jobList->add(GenerateBirthdayCalendarBackgroundJob::class, [
'userId' => $user->getUID(), 'userId' => $user->getUID(),
'purgeBeforeGenerating' => true 'purgeBeforeGenerating' => true