LoginSignup
0
0

More than 3 years have passed since last update.

Chewyを使用している際、Elasticsearchが落ちるとエラーになる対応

Last updated at Posted at 2019-12-05

概要

RailsでElasticsearchを使いたくてChewyを入れたが、Elasticsearchが落ちているとupdate_indexができなくなるので対応した

前提

ActiveJob(Sidekiq)が動いていること

Tips

対応

config/application.rb
    Chewy.request_strategy = :active_job
config/sidekiq.yml
:queues:
  - default
  - chewy

queuesにchewyを追加する

結果

ActiveJob側で接続が失敗するのでとりあえず動くようにはなる
Elasticsearchへの同期は失敗しているが、復帰すればActiveJobがリトライしてくれるはず

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0