0
0
Fork 0

Fix unnecessary queries when batch-removing statuses, 100x faster (#15387)

This commit is contained in:
Eugen Rochko 2020-12-22 17:13:55 +01:00 committed by GitHub
parent 67ebd61f11
commit 9915d11c0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 168 additions and 100 deletions

View file

@ -12,6 +12,10 @@ Chewy.settings = {
sidekiq: { queue: 'pull' },
}
# We use our own async strategy even outside the request-response
# 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 = :custom_sidekiq
Chewy.request_strategy = :custom_sidekiq
Chewy.use_after_commit_callbacks = false
@ -37,6 +41,7 @@ Elasticsearch::Transport::Client.prepend Module.new {
super arguments
end
}
Elasticsearch::API::Indices::IndicesClient.prepend Module.new {
def create(arguments = {})
arguments[:include_type_name] = true