Skip to content

Commit

Permalink
Log when a storage is marked as unavailable
Browse files Browse the repository at this point in the history
Signed-off-by: Morris Jobke <[email protected]>
  • Loading branch information
MorrisJobke authored and backportbot[bot] committed Mar 25, 2021
1 parent f6cbda9 commit 3fe7868
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/private/Files/Cache/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 3fe7868

Please sign in to comment.