Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/dav/lib/CardDAV/SyncService.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public function getLocalSystemAddressBook() {

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) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schiessle Will this have any negative effect on federation?

@blizzz blizzz Apr 23, 2019

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why should this affect federation? allForSeenUsers cycles over all known users. callForAllUsers might bring in new ones, but in any case it brings in a lot of overhead.

@georgehrke georgehrke Apr 23, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syncInstance syncs the address book containing all users for federation. So instead of all users only users that have logged in before will be synced (i assume).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, all the users known to Nextcloud. This can be more than have logged in.

$this->updateUser($user);
if (!is_null($progressCallback)) {
$progressCallback();
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Command/SyncBirthdayCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$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();
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Controller/BirthdayCalendarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function enable() {
$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(),
]);
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/Migration/RegenerateBirthdayCalendars.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function run(IOutput $output) {
}

$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
Expand All @@ -82,4 +82,4 @@ public function run(IOutput $output) {
// if all were done, no need to redo the repair during next upgrade
$this->config->setAppValue('dav', 'regeneratedBirthdayCalendarsForYearFix', 'yes');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testEnable() {
->with('dav', 'generateBirthdayCalendar', 'yes');

$this->userManager->expects($this->once())
->method('callForAllUsers')
->method('callForSeenUsers')
->will($this->returnCallback(function($closure) {
$user1 = $this->createMock(IUser::class);
$user1->method('getUID')->will($this->returnValue('uid1'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function testRun() {
->with('Adding background jobs to regenerate birthday calendar');

$this->userManager->expects($this->once())
->method('callForAllUsers')
->method('callForSeenUsers')
->will($this->returnCallback(function($closure) {
$user1 = $this->createMock(IUser::class);
$user1->method('getUID')->will($this->returnValue('uid1'));
Expand Down Expand Up @@ -128,10 +128,10 @@ public function testRunSecondTime() {
->with('Repair step already executed');

$this->userManager->expects($this->never())
->method('callForAllUsers');
->method('callForSeenUsers');

$this->migration->run($output);
}


}
}
2 changes: 0 additions & 2 deletions lib/private/User/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@

use OC\Cache\CappedMemoryCache;
use OCP\IDBConnection;
use OCP\ILogger;
use OCP\User\Backend\ABackend;
use OCP\User\Backend\ICheckPasswordBackend;
use OCP\User\Backend\ICountUsersBackend;
Expand All @@ -68,7 +67,6 @@
use OCP\User\Backend\IGetHomeBackend;
use OCP\User\Backend\ISetDisplayNameBackend;
use OCP\User\Backend\ISetPasswordBackend;
use OCP\Util;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\GenericEvent;

Expand Down