aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-01-24 10:46:02 +0100
committerRobin Appelman <robin@icewind.nl>2024-01-24 10:49:38 +0100
commit6fbf22ef5e3701e3041fedc155bd6ae2fbcd025a (patch)
tree0efef112e3e165e601df20431ea4dbc5cf1b1c27 /apps
parent594016110df7c91a46fe7137baa55cc724753080 (diff)
downloadnextcloud-server-6fbf22ef5e3701e3041fedc155bd6ae2fbcd025a.tar.gz
nextcloud-server-6fbf22ef5e3701e3041fedc155bd6ae2fbcd025a.zip
handle storage not available when expiring versions
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_versions/lib/Storage.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php
index 5e33059dcf8..07bd6b164d2 100644
--- a/apps/files_versions/lib/Storage.php
+++ b/apps/files_versions/lib/Storage.php
@@ -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.