Log when a storage is marked as unavailable
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
f6cbda9e60
commit
3fe78684ad
|
@ -31,6 +31,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
|
||||||
|
@ -176,6 +177,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')
|
||||||
|
|
Loading…
Reference in New Issue