Skip to content

Commit

Permalink
fix: Fix timeout when checking if news are available
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
marienfressinaud committed Oct 3, 2024
1 parent 855ff6f commit 4cec5ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/News.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4cec5ba

Please sign in to comment.