From 03e8e79424332cb64df88d5dc64445d6e68669e8 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 27 Mar 2026 02:02:19 +1300 Subject: [PATCH] (fix): remove dbForProject dependency from getDatabasesDB to prevent pool exhaustion --- app/init/resources.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/init/resources.php b/app/init/resources.php index fb1a3a9539..d055dd5b7e 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -703,9 +703,9 @@ Http::setResource('dbForPlatform', function (Group $pools, Cache $cache, Authori return $database; }, ['pools', 'cache', 'authorization']); -Http::setResource('getDatabasesDB', function (Group $pools, Cache $cache, Document $project, Request $request, UsageContext $usage, Authorization $authorization, Database $dbForProject) { +Http::setResource('getDatabasesDB', function (Group $pools, Cache $cache, Document $project, Request $request, UsageContext $usage, Authorization $authorization) { - return function (Document $database) use ($pools, $cache, $project, $request, $usage, $authorization, $dbForProject): Database { + return function (Document $database) use ($pools, $cache, $project, $request, $usage, $authorization): Database { $originalDatabase = $database; $context = str_contains($request->getURI(), '/tablesdb/') ? 'table' : 'collection'; $databaseDSN = $database->getAttribute('database', $project->getAttribute('database', '')); @@ -777,7 +777,6 @@ Http::setResource('getDatabasesDB', function (Group $pools, Cache $cache, Docume ->addHook(new Metadata( database: $originalDatabase, context: $context, - dbForProject: $dbForProject, authorization: $authorization, )); @@ -788,7 +787,7 @@ Http::setResource('getDatabasesDB', function (Group $pools, Cache $cache, Docume return $database; }; -}, ['pools','cache','project','request','usage','authorization', 'dbForProject']); +}, ['pools','cache','project','request','usage','authorization']); Http::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache, Authorization $authorization) { $databases = [];