always specify limit, except you do like questionable surprises, part 2
}
$output->writeln("Migrating keys for users on backend <info>$name</info>");
- $users = $backend->getUsers();
- foreach ($users as $user) {
+
+ $limit = 500;
+ $offset = 0;
+ do {
+ $users = $backend->getUsers('', $limit, $offset);
+ foreach ($users as $user) {
$output->writeln(" <info>$user</info>");
$migration->reorganizeFolderStructureForUser($user);
- }
+ }
+ $offset += $limit;
+ } while(count($users) >= $limit);
}
}
public function reorganizeFolderStructure() {
$this->reorganizeSystemFolderStructure();
- $users = \OCP\User::getUsers();
- foreach ($users as $user) {
- $this->reorganizeFolderStructureForUser($user);
- }
+ $limit = 500;
+ $offset = 0;
+ do {
+ $users = \OCP\User::getUsers('', $limit, $offset);
+ foreach ($users as $user) {
+ $this->reorganizeFolderStructureForUser($user);
+ }
+ $offset += $limit;
+ } while(count($users) >= $limit);
}
public function reorganizeSystemFolderStructure() {