Fix rubocop issues, introduce usage of frozen literal to improve performance
This commit is contained in:
parent
a91c3ef6ce
commit
fdc17bea58
96 changed files with 329 additions and 126 deletions
|
@ -1,10 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PrecomputeFeedService < BaseService
|
||||
# Fill up a user's home/mentions feed from DB and return a subset
|
||||
# @param [Symbol] type :home or :mentions
|
||||
# @param [Account] account
|
||||
def call(type, account)
|
||||
instant_return = []
|
||||
|
||||
Status.send("as_#{type}_timeline", account).limit(FeedManager::MAX_ITEMS).each do |status|
|
||||
next if FeedManager.instance.filter?(type, status, account)
|
||||
redis.zadd(FeedManager.instance.key(type, account.id), status.id, status.reblog? ? status.reblog_of_id : status.id)
|
||||
|
@ -14,6 +14,6 @@ class PrecomputeFeedService < BaseService
|
|||
private
|
||||
|
||||
def redis
|
||||
$redis
|
||||
Redis.current
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue