Skip to content

Commit 982cf03

Browse files
Revert "remove retries httpx plugin"
This reverts commit 98e0075.
1 parent 98e0075 commit 982cf03

File tree

1 file changed

+11
-0
lines changed
  • react_on_rails_pro/lib/react_on_rails_pro

1 file changed

+11
-0
lines changed

react_on_rails_pro/lib/react_on_rails_pro/request.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,17 @@ def create_connection
227227
# For persistent connections we want retries,
228228
# so the requests don't just fail if the other side closes the connection
229229
# https://honeyryderchuck.gitlab.io/httpx/wiki/Persistent
230+
.plugin(
231+
:retries,
232+
max_retries: 1,
233+
retry_change_requests: true,
234+
retry_after: ->(req, res) do
235+
Rails.logger.error("An error occured and retry is going to be made")
236+
Rails.logger.error("Error: #{res.error}")
237+
Rails.logger.error("Request Body: #{req.body}")
238+
0
239+
end,
240+
)
230241
.plugin(:stream)
231242
# See https://www.rubydoc.info/gems/httpx/1.3.3/HTTPX%2FOptions:initialize for the available options
232243
.with(

0 commit comments

Comments
 (0)