-
Notifications
You must be signed in to change notification settings - Fork 533
Model Callbacks create ES dependency? #897
Comments
Relevant to my interests. If I recall correctly, the If not able to reach the ES server at this time, the method will throw an exception causing the application to fail to boot. https://github.com/karmi/retire/blob/master/lib/tire/model/indexing.rb#L30-65 A good place to start would be to wrap the typical call to class Article
# ...
begin
mapping do
indexes :id, :index => :not_analyzed
indexes :title, :analyzer => 'snowball', :boost => 100
# ...
end
rescue Exception => e
logger.error "Failed to check/set index mapping during boot: #{e.message}"
end
end (Is that all correct and up to date? Been a while since I've read through this code.)
That's definitely a common one — an There's also another project, tire_async_index, which looks to extend Tire with Resque and Sidekiq support to process updates asynchronously. |
Followup, regarding "Model Callbacks" by which I suppose you mean Tire::Model::Callbacks. If those The best option is to use an approach which queues updates to be processed in a batch when the server is back on. That does seem to be a little outside of Tire's scope, so I'd be interested to learn how other people are doing that. |
Thank you for all of your awesome work on this project.
My ES provider (yeah, yeah, I'm lazy...) had an outage today that took down major parts of my application. Am I doing something to create a dependency on the ES service, or is there a dependency somewhere in the Tire callbacks? I think what's happening is that it's trying to update the index when I save my model, which is failing / timing out in some way, which is timing out the entire request.
The text was updated successfully, but these errors were encountered: