I have to broadcast a message right after indexing has completed.
.import! Initiates the indexes and then my broadcast runs even before indexing has completed which results in displaying of old data. How can I make sure to run a broadcast line once indexes has completed in ruby?
Chewy Version
'chewy', '~> 7.3.3'
Chewy.strategy(:urgent) do
Index.import!(Table.where(id: reg_ids))
#I want below line to run after above indexes has completed
ActionCable.server.broadcast("data_#{user_id}", {body: { user_id: user_id}})
I have to broadcast a message right after indexing has completed.
.import! Initiates the indexes and then my broadcast runs even before indexing has completed which results in displaying of old data. How can I make sure to run a broadcast line once indexes has completed in ruby?
Chewy Version 'chewy', '~> 7.3.3'
Chewy.strategy(:urgent) do Index.import!(Table.where(id: reg_ids))
end