Skip to content

Run some code after indexing has completed #941

@DeltaMuzammal

Description

@DeltaMuzammal

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions