Skip to content
Snippets Groups Projects
Commit cf8be87e authored by Morris Jobke's avatar Morris Jobke Committed by backportbot[bot]
Browse files

Log when a storage is marked as unavailable


Signed-off-by: default avatarMorris Jobke <hey@morrisjobke.de>
parent 769c6fed
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
namespace OC\Files\Cache; namespace OC\Files\Cache;
use OCP\Files\Storage\IStorage; use OCP\Files\Storage\IStorage;
use Psr\Log\LoggerInterface;
/** /**
* Handle the mapping between the string and numeric storage ids * Handle the mapping between the string and numeric storage ids
...@@ -175,6 +176,9 @@ class Storage { ...@@ -175,6 +176,9 @@ class Storage {
*/ */
public function setAvailability($isAvailable, int $delay = 0) { public function setAvailability($isAvailable, int $delay = 0) {
$available = $isAvailable ? 1 : 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 = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$query->update('storages') $query->update('storages')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment