fcm icon indicating copy to clipboard operation
fcm copied to clipboard

Automatic retry with exponential backoff

Open Alan-M-Thomaz opened this issue 6 years ago • 4 comments

Implemented it using the recently added gem Faraday, when it is status 5xx or 200 and any of the results form body is error:Unavaible, it will retry the whole request, with an exponential interval. passed on simple rspec test with webmock stubs. I'm not sure if those interval params where good the exponential backoff.

Also updated group notification url to fcm url. https://github.com/spacialdb/fcm/issues/56

ToDo

Implement a Retry faraday middleware that allow editing the body of the request before resend it, so when it is 200 + error:unavaible, we can resend it only for the registration_ids that failed, instead to sending for all.

Alan-M-Thomaz avatar Mar 29 '19 14:03 Alan-M-Thomaz

oh, i just screw the other http errors, i will be fixing it

Alan-M-Thomaz avatar Mar 29 '19 15:03 Alan-M-Thomaz

cool thanks... let me know when you are ready to review

kashif avatar Apr 01 '19 15:04 kashif

it's fixed, just removed the error raise middleware, it was causing more problems than helping, refactored to use just retryable_statuses.

Alan-M-Thomaz avatar Apr 01 '19 17:04 Alan-M-Thomaz

Hi - great work on the PR. Is there a plan to get this merged soon? We're using the gem and are trying to work out if we can wait for this PR or if we need to create our own fork. Thanks!

dgmstuart avatar May 07 '19 08:05 dgmstuart