mirror of
https://github.com/nextcloud/server.git
synced 2026-02-11 06:44:09 -05:00
handle storage not available when expiring versions
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
594016110d
commit
6fbf22ef5e
1 changed files with 5 additions and 0 deletions
|
|
@ -63,6 +63,7 @@ use OCP\Files\Node;
|
|||
use OCP\Files\NotFoundException;
|
||||
use OCP\Files\Search\ISearchBinaryOperator;
|
||||
use OCP\Files\Search\ISearchComparison;
|
||||
use OCP\Files\StorageInvalidException;
|
||||
use OCP\Files\StorageNotAvailableException;
|
||||
use OCP\IURLGenerator;
|
||||
use OCP\IUser;
|
||||
|
|
@ -603,6 +604,10 @@ class Storage {
|
|||
} catch (NotFoundException $e) {
|
||||
// Original node not found, delete the version
|
||||
return true;
|
||||
} catch (StorageNotAvailableException | StorageInvalidException $e) {
|
||||
// Storage can't be used, but it might only be temporary so we can't always delete the version
|
||||
// since we can't determine if the version is named we take the safe route and don't expire
|
||||
return false;
|
||||
} catch (DoesNotExistException $ex) {
|
||||
// Version on FS can have no equivalent in the DB if they were created before the version naming feature.
|
||||
// So we ignore DoesNotExistException.
|
||||
|
|
|
|||
Loading…
Reference in a new issue