Commit 6040e1ba authored by Valery Sizov's avatar Valery Sizov

ES: fix situation when ES is disabled

parent f24eaccb
......@@ -44,9 +44,19 @@ module ApplicationSearch
}
}
after_commit ->{ ElasticIndexerWorker.perform_async(:index, self.class.to_s, self.id) }, on: :create
after_commit ->{ ElasticIndexerWorker.perform_async(:update, self.class.to_s, self.id) }, on: :update
after_commit ->{ ElasticIndexerWorker.perform_async(:delete, self.class.to_s, self.id) }, on: :destroy
if Gitlab.config.elasticsearch.enabled
after_commit on: :create do
ElasticIndexerWorker.perform_async(:index, self.class.to_s, self.id)
end
after_commit on: :update do
ElasticIndexerWorker.perform_async(:update, self.class.to_s, self.id)
end
after_commit on: :destroy do
ElasticIndexerWorker.perform_async(:delete, self.class.to_s, self.id)
end
end
end
module ClassMethods
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment