Skip to content

Commit

Permalink
Merge pull request #26302 from nextcloud/backport/26299/stable20
Browse files Browse the repository at this point in the history
[stable20] Log when a storage is marked as unavailable
  • Loading branch information
MorrisJobke authored Mar 25, 2021
2 parents f6cbda9 + 3fe7868 commit a9df50c
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 a9df50c

Please sign in to comment.