From 0dfffb6dcb48f881a39c17841ce8f02087d219d6 Mon Sep 17 00:00:00 2001 From: Shunsuke Michii Date: Tue, 16 May 2017 19:12:29 +0900 Subject: Make faster ProcessFeedService (#3080) * Add index accounts on uri. * Remove a blank line. --- app/services/process_feed_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/services/process_feed_service.rb b/app/services/process_feed_service.rb index afd44aafe..c573c0490 100644 --- a/app/services/process_feed_service.rb +++ b/app/services/process_feed_service.rb @@ -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 -- cgit