Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable21] Log when a storage is marked as unavailable #26301

Merged
merged 1 commit into from
Mar 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/private/Files/Cache/Storage.php
Expand Up @@ -30,6 +30,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 @@ -175,6 +176,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