Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81148dd7 authored by theronakpatel's avatar theronakpatel
Browse files

added count

parent f6174ff2
Loading
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -118,17 +118,20 @@ class SyncMissingUsersToCommon extends Command {
	 * Process all users from NextCloud
	 */
	private function processAllUsers(string $ipAddress, bool $isDryRun, OutputInterface $output, array &$stats): void {
		$output->writeln('<info>Processing all users from NextCloud</info>');

		$this->userManager->callForAllUsers(function (IUser $user) use ($ipAddress, $isDryRun, $output, &$stats) {
			$username = $user->getUID();
		$allUsers = [];
		$this->userManager->callForAllUsers(function (IUser $user) use (&$allUsers) {
			$allUsers[] = $user;
		});
		$totalUsers = count($allUsers);
		$output->writeln(sprintf('<info>Processing all users from NextCloud (total: %d)</info>', $totalUsers));

			$this->processSingleUser($username, $ipAddress, $isDryRun, $output, $stats);
		foreach ($allUsers as $user) {
			$this->processSingleUser($user->getUID(), $ipAddress, $isDryRun, $output, $stats);
			if ($stats['processed'] % 100 === 0) {
				$output->writeln(sprintf('<info>Progress: %d processed, %d success, %d errors</info>',
					$stats['processed'], $stats['success'], $stats['errors']));
			}
		});
		}
	}

	/**