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) {
$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();

View 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();

View 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(),
]);

View 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');
}
}
}