workflow icon indicating copy to clipboard operation
workflow copied to clipboard

Problems with thinkingsphinx index updates

Open shoresh opened this issue 1 year ago • 0 comments

The thinkingsphinx gem is used to connect rails model with the sphinx search engine. We are using realtime indexes which require that a call be made when the data changes to update the index. We have placed that call in both the after_save method of the model as well as in the on_transition hook of the workflow engine:

  on_transition do |from, to, triggering_event, *event_args|
    unless from == to
      ThinkingSphinx::RealTime.callback_for(:scapp)
    end
  end

It looks like this callback is not working. If we change another column in the record the index is updated. In other words, the after_save hook is working. If we only change the status field in the record (through the workflow transition) the record is not updated. In this case we can see in the log that the index update occurs before the status is changed by the workflow engine. Do you have any advice for how to correct this problem? Are we doing something wrong?

Thanks

shoresh avatar Feb 18 '24 00:02 shoresh