You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This is needed due to us using another gem whose model writes to both primary_shard and secondary_shard and its model inherits from ActiveRecord::BaseActiveRecord::Base.instance_evaldoconnects_toshards: {primary_shard: {writing: :primary_shard,},secondary_shard: {writing: :secondary_shard,},}end
SolidQueue has been working well, the only time where we cannot enqueue is if we have a block of code like below:
I think it is because SolidQueue is trying to insert the job into secondary_shard instead of the queue database. Is there any way to circumvent this besides rewriting the code to call perform_later outside of the connected_to block? SomeJob.perform_later might be called inside a function with the connected_to block so it's quite a big refactor for us.
The text was updated successfully, but these errors were encountered:
Same issue here. is there a workaround? my entire controller is in a connected_to block?
I tried wrapping the perform_later in another connection switch but no luck.
My rails application connects to multiple databases with the configs below:
database.yml
config/initializers/database.rb
SolidQueue
has been working well, the only time where we cannot enqueue is if we have a block of code like below:I think it is because
SolidQueue
is trying to insert the job intosecondary_shard
instead of thequeue
database. Is there any way to circumvent this besides rewriting the code to callperform_later
outside of theconnected_to
block?SomeJob.perform_later
might be called inside a function with theconnected_to
block so it's quite a big refactor for us.The text was updated successfully, but these errors were encountered: