Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run some code after indexing has completed #941

Open
DeltaMuzammal opened this issue Apr 18, 2024 · 0 comments
Open

Run some code after indexing has completed #941

DeltaMuzammal opened this issue Apr 18, 2024 · 0 comments

Comments

@DeltaMuzammal
Copy link

DeltaMuzammal commented Apr 18, 2024

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}})

end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant