Skip to content

Commit c25daf5

Browse files
authored
Merge pull request #26299 from nextcloud/enh/noid/log-storage-unavailable
Log when a storage is marked as unavailable
2 parents 570c25c + 81fef4d commit c25daf5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/private/Files/Cache/Storage.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
namespace OC\Files\Cache;
3131

3232
use OCP\Files\Storage\IStorage;
33+
use Psr\Log\LoggerInterface;
3334

3435
/**
3536
* Handle the mapping between the string and numeric storage ids
@@ -175,6 +176,9 @@ public function getAvailability() {
175176
*/
176177
public function setAvailability($isAvailable, int $delay = 0) {
177178
$available = $isAvailable ? 1 : 0;
179+
if (!$isAvailable) {
180+
\OC::$server->get(LoggerInterface::class)->info('Storage with ' . $this->storageId . ' marked as unavailable', ['app' => 'lib']);
181+
}
178182

179183
$query = \OC::$server->getDatabaseConnection()->getQueryBuilder();
180184
$query->update('storages')

0 commit comments

Comments
 (0)