Optimize contact linked status update #2477

This commit is contained in:
Priit Tark 2015-07-23 20:02:01 +03:00
parent 8700beea60
commit 48bc4d4ac9
3 changed files with 48 additions and 19 deletions

View file

@ -44,18 +44,27 @@ Rails.application.configure do
# The available log levels are: :debug, :info, :warn, :error, :fatal, and :unknown,
# corresponding to the log level numbers from 0 up to 5 respectively
config.log_level = :info
config.log_level = :debug
# for finding database optimization
config.after_initialize do
Bullet.enable = true
Bullet.bullet_logger = true
Bullet.rails_logger = true
Bullet.raise = true # raise an error if n+1 query occurs
Bullet.unused_eager_loading_enable = false
# Currenty hard to fix, it is triggered by Epp::Domain.new_from_epp for create request
Bullet.add_whitelist type: :n_plus_one_query, class_name: 'Contact', association: :registrar
# when domain updates, then we need to update all contact linked status,
# somehow it triggers bullet counter cache for versions,
# there was no output indicating each version where fetched or counted
# thus needs more investigation
Bullet.add_whitelist type: :counter_cache, class_name: 'Contact', association: :versions
end
# config.logger = Logger.new(STDOUT)
end
# In this mode, any jobs you queue will be run in the same thread, synchronously