0
0
Fork 0

Make faster ProcessFeedService (#3080)

* Add index accounts on uri.

* Remove a blank line.
This commit is contained in:
Shunsuke Michii 2017-05-16 19:12:29 +09:00 committed by Eugen Rochko
parent 1b0a5658f1
commit 0dfffb6dcb
3 changed files with 8 additions and 2 deletions

View file

@ -209,7 +209,7 @@ class ProcessFeedService < BaseService
if TagManager.instance.web_domain?(url.host)
Account.find_local(url.path.gsub('/users/', ''))
else
Account.find_by(uri: href) || Account.find_by(url: href) || FetchRemoteAccountService.new.call(href)
Account.where(uri: href).or(Account.where(url: href)).first || FetchRemoteAccountService.new.call(href)
end
end