File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
react_on_rails_pro/lib/react_on_rails_pro Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,16 @@ 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 ( :retries , max_retries : 1 , retry_change_requests : true )
230+ . plugin (
231+ :retries ,
232+ retry_change_requests : true ,
233+ retry_after : -> ( req , res ) do
234+ Rails . logger . error ( "An error occured and retry is going to be made" )
235+ Rails . logger . error ( "Error: #{ res . error } " )
236+ Rails . logger . error ( "Request Body: #{ req . body } " )
237+ 0
238+ end ,
239+ )
231240 . plugin ( :stream )
232241 # See https://www.rubydoc.info/gems/httpx/1.3.3/HTTPX%2FOptions:initialize for the available options
233242 . with (
You can’t perform that action at this time.
0 commit comments