From cca82bf0a2f0ccbf0feda00763fd7df0877845b6 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 23 Jan 2017 21:29:34 +0100 Subject: Move merging/unmerging of timelines into background. Move blocking into background as well since it's a computationally expensive --- app/controllers/api/v1/accounts_controller.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'app/controllers/api/v1/accounts_controller.rb') diff --git a/app/controllers/api/v1/accounts_controller.rb b/app/controllers/api/v1/accounts_controller.rb index bd52dfb2c..234844ed7 100644 --- a/app/controllers/api/v1/accounts_controller.rb +++ b/app/controllers/api/v1/accounts_controller.rb @@ -65,8 +65,13 @@ class Api::V1::AccountsController < ApiController end def block - BlockService.new.call(current_user.account, @account) - set_relationship + BlockWorker.perform_async(current_user.account_id, @account.id) + + @following = { @account.id => false } + @followed_by = { @account.id => false } + @blocking = { @account.id => true } + @requested = { @account.id => false } + render action: :relationship end -- cgit