From 49ef811d253cee5607255c1a1d5e0d844a89805c Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Thu, 3 Apr 2025 13:28:14 +0200 Subject: [PATCH] Load queries asynchronously to leverage concurrency --- app/controllers/bubbles_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/bubbles_controller.rb b/app/controllers/bubbles_controller.rb index d64f76a38..6d86e5bda 100644 --- a/app/controllers/bubbles_controller.rb +++ b/app/controllers/bubbles_controller.rb @@ -12,9 +12,9 @@ class BubblesController < ApplicationController RECENTLY_POPPED_LIMIT = 100 def index - @considering_bubbles = @filter.bubbles.considering - @doing_bubbles = @filter.bubbles.doing - @popped_bubbles = @filter.with(indexed_by: "popped").bubbles.limit(RECENTLY_POPPED_LIMIT) + @considering_bubbles = @filter.bubbles.considering.load_async + @doing_bubbles = @filter.bubbles.doing.load_async + @popped_bubbles = @filter.with(indexed_by: "popped").bubbles.limit(RECENTLY_POPPED_LIMIT).load_async end def create