fix: Use the new countUsersTotal method where it makes sense

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2025-01-14 12:38:02 +01:00
parent e187e4e87f
commit b45bc2a462
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A
2 changed files with 2 additions and 3 deletions

View file

@ -33,7 +33,7 @@ class Version1027Date20230504122946 extends SimpleMigrationStep {
* @param array $options
*/
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
if ($this->userManager->countSeenUsers() > 100 || array_sum($this->userManager->countUsers()) > 100) {
if ($this->userManager->countSeenUsers() > 100 || $this->userManager->countUsersTotal(100) >= 100) {
$this->config->setAppValue('dav', 'needs_system_address_book_sync', 'yes');
$output->info('Could not sync system address books during update - too many user records have been found. Please call occ dav:sync-system-addressbook manually.');
return;

View file

@ -279,8 +279,7 @@ class OC {
}
if (!$tooBig) {
// count users
$stats = Server::get(\OCP\IUserManager::class)->countUsers();
$totalUsers = array_sum($stats);
$totalUsers = Server::get(\OCP\IUserManager::class)->countUsersTotal(51);
$tooBig = ($totalUsers > 50);
}
}