From 775c1848b73ccba6c8e89773caa0a49eb5b0166d Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 8 Jun 2026 15:38:32 +0200 Subject: [PATCH] test: don't trigger file cache gc during tests Signed-off-by: Robin Appelman --- lib/OC.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/OC.php b/lib/OC.php index ed346507d3a..c7072df64b8 100644 --- a/lib/OC.php +++ b/lib/OC.php @@ -1017,23 +1017,23 @@ class OC { $request = Server::get(IRequest::class); $throttler = Server::get(IThrottler::class); $throttler->resetDelay($request->getRemoteAddress(), 'login', ['user' => $uid]); - } - try { - $cache = new \OC\Cache\File(); - $cache->gc(); - } catch (\OC\ServerNotAvailableException $e) { - // not a GC exception, pass it on - throw $e; - } catch (\OC\ForbiddenException $e) { - // filesystem blocked for this request, ignore - } catch (\Exception $e) { - // a GC exception should not prevent users from using OC, - // so log the exception - Server::get(LoggerInterface::class)->warning('Exception when running cache gc.', [ - 'app' => 'core', - 'exception' => $e, - ]); + try { + $cache = new \OC\Cache\File(); + $cache->gc(); + } catch (\OC\ServerNotAvailableException $e) { + // not a GC exception, pass it on + throw $e; + } catch (\OC\ForbiddenException $e) { + // filesystem blocked for this request, ignore + } catch (\Exception $e) { + // a GC exception should not prevent users from using OC, + // so log the exception + Server::get(LoggerInterface::class)->warning('Exception when running cache gc.', [ + 'app' => 'core', + 'exception' => $e, + ]); + } } }); }