Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use method to get free space
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal authored and backportbot-nextcloud[bot] committed Jun 10, 2022
commit 1f609c4dd14c9abbfa96b55939388d6ff2442560
7 changes: 2 additions & 5 deletions lib/Service/UserMigrationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,8 @@ private function estimateExportSize(IUser $user, ?array $filteredMigratorList =
*/
public function checkExportability(IUser $user, ?array $filteredMigratorList = null): void {
try {
OC_Util::tearDownFS();
OC_Util::setupFS($user->getUID());
$storageInfo = OC_Helper::getStorageInfo('/');
// TODO safe to cache?
$freeSpace = (int)ceil($storageInfo['free'] / 1024);
$userFolder = $this->root->getUserFolder($user->getUID());
$freeSpace = (int)ceil($userFolder->getFreeSpace() / 1024);
} catch (Throwable $e) {
throw new NotExportableException('Error calculating amount of free space available');
}
Expand Down