From 3fe78684ad817cafedab6e1bcff84fa213a340d5 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 25 Mar 2021 16:14:20 +0100 Subject: [PATCH] Log when a storage is marked as unavailable Signed-off-by: Morris Jobke --- lib/private/Files/Cache/Storage.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/private/Files/Cache/Storage.php b/lib/private/Files/Cache/Storage.php index b11cd5799de61..ece1df695d7e2 100644 --- a/lib/private/Files/Cache/Storage.php +++ b/lib/private/Files/Cache/Storage.php @@ -31,6 +31,7 @@ namespace OC\Files\Cache; use OCP\Files\Storage\IStorage; +use Psr\Log\LoggerInterface; /** * Handle the mapping between the string and numeric storage ids @@ -176,6 +177,9 @@ public function getAvailability() { */ public function setAvailability($isAvailable, int $delay = 0) { $available = $isAvailable ? 1 : 0; + if (!$isAvailable) { + \OC::$server->get(LoggerInterface::class)->info('Storage with ' . $this->storageId . ' marked as unavailable', ['app' => 'lib']); + } $query = \OC::$server->getDatabaseConnection()->getQueryBuilder(); $query->update('storages')