~cytrogen/masto-fe

f432db7b9f54501269c6377faf85b1b4b1424239 — Claire 3 years ago 1ed12d5
Fix sidekiq jobs not triggering Elasticsearch index updates (#24046)

3 files changed, 5 insertions(+), 4 deletions(-)

M bin/tootctl
M config/initializers/chewy.rb
M lib/mastodon/sidekiq_middleware.rb
M bin/tootctl => bin/tootctl +3 -1
@@ 5,7 5,9 @@ require_relative '../config/boot'
require_relative '../lib/cli'

begin
  Mastodon::CLI.start(ARGV)
  Chewy.strategy(:mastodon) do
    Mastodon::CLI.start(ARGV)
  end
rescue Interrupt
  exit(130)
end

M config/initializers/chewy.rb => config/initializers/chewy.rb +0 -1
@@ 19,7 19,6 @@ Chewy.settings = {
# cycle, which takes care of checking if Elasticsearch is enabled
# or not. However, mind that for the Rails console, the :urgent
# strategy is set automatically with no way to override it.
Chewy.root_strategy              = :mastodon
Chewy.request_strategy           = :mastodon
Chewy.use_after_commit_callbacks = false


M lib/mastodon/sidekiq_middleware.rb => lib/mastodon/sidekiq_middleware.rb +2 -2
@@ 3,8 3,8 @@
class Mastodon::SidekiqMiddleware
  BACKTRACE_LIMIT = 3

  def call(*)
    yield
  def call(*, &block)
    Chewy.strategy(:mastodon, &block)
  rescue Mastodon::HostValidationError
    # Do not retry
  rescue => e