Add counter caches for a large performance increase on API requests
This commit is contained in:
parent
333e44c3fc
commit
de22c202f5
13 changed files with 41 additions and 22 deletions
|
@ -14,8 +14,8 @@ class Api::V1::NotificationsController < ApiController
|
|||
statuses = @notifications.select { |n| !n.target_status.nil? }.map(&:target_status)
|
||||
|
||||
set_maps(statuses)
|
||||
set_counters_maps(statuses)
|
||||
set_account_counters_maps(@notifications.map(&:from_account))
|
||||
# set_counters_maps(statuses)
|
||||
# set_account_counters_maps(@notifications.map(&:from_account))
|
||||
|
||||
next_path = api_v1_notifications_url(max_id: @notifications.last.id) unless @notifications.empty?
|
||||
prev_path = api_v1_notifications_url(since_id: @notifications.first.id) unless @notifications.empty?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue