mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
always specify limit, except you do like questionable surprises
always specify limit, except you do like questionable surprises, part 2
This commit is contained in:
parent
80e38b84dc
commit
15b2d33599
2 changed files with 18 additions and 7 deletions
|
|
@ -62,11 +62,17 @@ class MigrateKeys extends Command {
|
|||
}
|
||||
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,10 +42,15 @@ class Migration {
|
|||
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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue