Make unfavouriting async to prevent timeout errors from leaving orphaned records behind
This commit is contained in:
1 parent
6b67b55cee
commit
0542773bca
3 files changed
+15
-2
No files matched your search
@@ -83,7 +83,11 @@ class Api::V1::StatusesController < ApiController
|
||||
end
|
||||
|
||||
def unfavourite
|
||||
@status = UnfavouriteService.new.call(current_user.account, Status.find(params[:id])).status.reload
|
||||
@status = Status.find(params[:id])
|
||||
@favourited_map = { @status.id => false }
|
||||
|
||||
UnfavouriteWorker.perform_async(current_user.account_id, @status.id)
|
||||
|
||||
render action: :show
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user