Merge pull request #30510 from nextcloud/user-cleanup-storage-before-cache

delete files before cleaning cache when cleaning user files
pull/33307/head
Vincent Petry 2022-07-26 23:08:04 +07:00 committed by GitHub
commit cb9f3423e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

@ -72,12 +72,12 @@ class UserDeletedFilesCleanupListener implements IEventListener {
} }
$storage = $this->homeStorageCache[$event->getUser()->getUID()]; $storage = $this->homeStorageCache[$event->getUser()->getUID()];
$cache = $storage->getCache(); $cache = $storage->getCache();
$storage->rmdir('');
if ($cache instanceof Cache) { if ($cache instanceof Cache) {
$cache->clear(); $cache->clear();
} else { } else {
throw new \Exception("Home storage has invalid cache"); throw new \Exception("Home storage has invalid cache");
} }
$storage->rmdir('');
} }
} }
} }