Skip to content

Commit e757101

Browse files
committed
test: don't trigger file cache gc during tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent cbc8033 commit e757101

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

lib/base.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -980,23 +980,23 @@ public static function registerCleanupHooks(\OC\SystemConfig $systemConfig): voi
980980
$request = Server::get(IRequest::class);
981981
$throttler = Server::get(IThrottler::class);
982982
$throttler->resetDelay($request->getRemoteAddress(), 'login', ['user' => $uid]);
983-
}
984983

985-
try {
986-
$cache = new \OC\Cache\File();
987-
$cache->gc();
988-
} catch (\OC\ServerNotAvailableException $e) {
989-
// not a GC exception, pass it on
990-
throw $e;
991-
} catch (\OC\ForbiddenException $e) {
992-
// filesystem blocked for this request, ignore
993-
} catch (\Exception $e) {
994-
// a GC exception should not prevent users from using OC,
995-
// so log the exception
996-
Server::get(LoggerInterface::class)->warning('Exception when running cache gc.', [
997-
'app' => 'core',
998-
'exception' => $e,
999-
]);
984+
try {
985+
$cache = new \OC\Cache\File();
986+
$cache->gc();
987+
} catch (\OC\ServerNotAvailableException $e) {
988+
// not a GC exception, pass it on
989+
throw $e;
990+
} catch (\OC\ForbiddenException $e) {
991+
// filesystem blocked for this request, ignore
992+
} catch (\Exception $e) {
993+
// a GC exception should not prevent users from using OC,
994+
// so log the exception
995+
Server::get(LoggerInterface::class)->warning('Exception when running cache gc.', [
996+
'app' => 'core',
997+
'exception' => $e,
998+
]);
999+
}
10001000
}
10011001
});
10021002
}

0 commit comments

Comments
 (0)