Use a writing role for some sidekiq worker reads

This commit is contained in:
Fosco Marotto
2021-02-18 15:02:16 -05:00
parent de7d71e0ee
commit 4696307cc9
2 changed files with 8 additions and 4 deletions

View File

@@ -4,6 +4,8 @@ class BootstrapTimelineWorker
include Sidekiq::Worker
def perform(account_id)
BootstrapTimelineService.new.call(Account.find(account_id))
ActiveRecord::Base.connected_to(role: :writing) do
BootstrapTimelineService.new.call(Account.find(account_id))
end
end
end