0
0
Fork 0

Add counter caches for a large performance increase on API requests

This commit is contained in:
Eugen Rochko 2017-03-30 15:06:59 +02:00
parent 333e44c3fc
commit de22c202f5
13 changed files with 41 additions and 22 deletions

View file

@ -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?