about summary refs log tree commit diff
path: root/app/workers/activitypub
diff options
context:
space:
mode:
authorabcang <abcang1015@gmail.com>2017-10-14 21:38:57 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-10-14 14:38:57 +0200
commit2eab41cd1a38fd382a735f32c6ecba7ec193f6f2 (patch)
treed48bce55d3f908ab17848e4f7e415ae9d98982e4 /app/workers/activitypub
parentc6f76db2e16decc1bc1483e616933f561d627c36 (diff)
Close connection when succeeded posting (#5390)
* Close connection when succeeded posting

* Update webmock
Diffstat (limited to 'app/workers/activitypub')
-rw-r--r--app/workers/activitypub/delivery_worker.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/workers/activitypub/delivery_worker.rb b/app/workers/activitypub/delivery_worker.rb
index 7b1e06a70..ae86e3dd2 100644
--- a/app/workers/activitypub/delivery_worker.rb
+++ b/app/workers/activitypub/delivery_worker.rb
@@ -16,6 +16,7 @@ class ActivityPub::DeliveryWorker
 
     raise Mastodon::UnexpectedResponseError, @response unless response_successful?
 
+    @response.connection&.close
     failure_tracker.track_success!
   rescue => e
     failure_tracker.track_failure!
@@ -31,7 +32,7 @@ class ActivityPub::DeliveryWorker
   end
 
   def perform_request
-    @response = build_request.perform.flush
+    @response = build_request.perform
   end
 
   def response_successful?