about summary refs log tree commit diff
path: root/app/controllers/api/v1
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-23 21:29:34 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-23 21:29:34 +0100
commitcca82bf0a2f0ccbf0feda00763fd7df0877845b6 (patch)
tree98afb883aa236dbeaf011944faa1548e7698deb7 /app/controllers/api/v1
parentf392030ab82a70086f93bb02c3faab53c3fbd28e (diff)
Move merging/unmerging of timelines into background. Move blocking into
background as well since it's a computationally expensive
Diffstat (limited to 'app/controllers/api/v1')
-rw-r--r--app/controllers/api/v1/accounts_controller.rb9
1 files changed, 7 insertions, 2 deletions
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