From 4cec5ba9c4109ea165864c592c074b7d8f402231 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 3 Oct 2024 22:12:05 +0200 Subject: [PATCH] fix: Fix timeout when checking if news are available For some reasons, PostgreSQL doesn't use the same strategy to pick one or more links in the NewsPicker. In production, picking one link can take up to ~80 seconds with my account, while it takes less than 1s for more links. --- src/controllers/News.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/News.php b/src/controllers/News.php index 80ca47ab..606d500c 100644 --- a/src/controllers/News.php +++ b/src/controllers/News.php @@ -124,7 +124,7 @@ public function showAvailable(Request $request): Response } $news_picker = new services\NewsPicker($user); - $links = $news_picker->pick(max: 1); + $links = $news_picker->pick(max: 2); return Response::json(200, [ 'available' => count($links) > 0,