Merge pull request #25505 from nextcloud/versions-expire-handle-unavailable

dont stop expiring versions if we cant check if the source file still exists
This commit is contained in:
Roeland Jago Douma 2021-02-06 10:57:14 +01:00 committed by GitHub
commit 6b1a4fa983
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -53,6 +53,7 @@ use OCA\Files_Versions\Command\Expire;
use OCA\Files_Versions\Events\CreateVersionEvent;
use OCA\Files_Versions\Versions\IVersionManager;
use OCP\Files\NotFoundException;
use OCP\Files\StorageNotAvailableException;
use OCP\IUser;
use OCP\Lock\ILockingProvider;
use OCP\User;
@ -724,8 +725,14 @@ class Storage {
\OC_Util::setupFS($uid);
if (!Filesystem::file_exists($filename)) {
return false;
try {
if (!Filesystem::file_exists($filename)) {
return false;
}
} catch (StorageNotAvailableException $e) {
// if we can't check that the file hasn't been deleted we can only assume that it hasn't
// note that this `StorageNotAvailableException` is about the file the versions originate from,
// not the storage that the versions are stored on
}
if (empty($filename)) {