diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-03-30 04:47:04 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-03-30 04:47:04 +0200 |
commit | 35933167c0c84033d062a6cc73213fc4c222e4d3 (patch) | |
tree | 243a02cc98ceba378a8cdad0d32047d0d4c2cae7 /app/controllers/api/v1/blocks_controller.rb | |
parent | bb7006bda1fac9b261944a51e497569cfcf2d1be (diff) |
Add counter caches for a large performance increase on API requests
Diffstat (limited to 'app/controllers/api/v1/blocks_controller.rb')
-rw-r--r-- | app/controllers/api/v1/blocks_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/api/v1/blocks_controller.rb b/app/controllers/api/v1/blocks_controller.rb index 08aefc175..dadf21265 100644 --- a/app/controllers/api/v1/blocks_controller.rb +++ b/app/controllers/api/v1/blocks_controller.rb @@ -11,7 +11,7 @@ class Api::V1::BlocksController < ApiController accounts = Account.where(id: results.map(&:target_account_id)).map { |a| [a.id, a] }.to_h @accounts = results.map { |f| accounts[f.target_account_id] }.compact - set_account_counters_maps(@accounts) + # set_account_counters_maps(@accounts) next_path = api_v1_blocks_url(max_id: results.last.id) if results.size == limit_param(DEFAULT_ACCOUNTS_LIMIT) prev_path = api_v1_blocks_url(since_id: results.first.id) unless results.empty? |