Add timeouts to deliver worker

parent 080b943d
Pipeline #151 passed with stage
in 51 seconds
......@@ -28,7 +28,11 @@ class DeliverWorker
headers["Signature"] = %(keyId="#{PubRelay.route_url("/actor")}",headers="#{signed_headers}",signature="#{Base64.strict_encode(signature)}")
response = HTTP::Client.post(inbox_url, headers: headers, body: request_body)
client = HTTP::Client.new(inbox_url)
client.dns_timeout = 10.seconds
client.connect_timeout = 10.seconds
client.read_timeout = 10.seconds
response = client.post(inbox_url.full_path, headers: headers, body: request_body)
puts "POST #{inbox_url} #{response.status_code}"
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment