From 2eab41cd1a38fd382a735f32c6ecba7ec193f6f2 Mon Sep 17 00:00:00 2001 From: abcang Date: Sat, 14 Oct 2017 21:38:57 +0900 Subject: Close connection when succeeded posting (#5390) * Close connection when succeeded posting * Update webmock --- app/services/subscribe_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/services/subscribe_service.rb') diff --git a/app/services/subscribe_service.rb b/app/services/subscribe_service.rb index 2d8af0203..2f725e2ec 100644 --- a/app/services/subscribe_service.rb +++ b/app/services/subscribe_service.rb @@ -6,7 +6,7 @@ class SubscribeService < BaseService @account = account @account.secret = SecureRandom.hex - @response = build_request.perform.flush + @response = build_request.perform if response_failed_permanently? # We're not allowed to subscribe. Fail and move on. @@ -20,6 +20,7 @@ class SubscribeService < BaseService # We need to retry at a later time. Fail loudly! raise Mastodon::UnexpectedResponseError, @response end + @response.connection&.close end private -- cgit