rybalkinsd / kohttp

Kotlin DSL http client
https://kohttp.gitbook.io
Apache License 2.0
478 stars 42 forks source link

handle Retry-After header #151

Open doyaaaaaken opened 5 years ago

doyaaaaaken commented 5 years ago

Fixes #105 #108

Read Retry-After response header, and decide when to retry next.

This is WIP pull request, so below tasks are not started.

Please review whether the direction is correct.

codecov[bot] commented 5 years ago

Codecov Report

Merging #151 into master will increase coverage by 0.08%. The diff coverage is 95%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #151      +/-   ##
============================================
+ Coverage     90.47%   90.55%   +0.08%     
- Complexity      128      137       +9     
============================================
  Files            42       42              
  Lines           399      413      +14     
  Branches         45       50       +5     
============================================
+ Hits            361      374      +13     
  Misses           14       14              
- Partials         24       25       +1
Impacted Files Coverage Δ Complexity Δ
...rybalkinsd/kohttp/interceptors/RetryInterceptor.kt 93.93% <95%> (-0.8%) 21 <15> (+9)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1ac0a9b...c3a0dc8. Read the comment docs.

rybalkinsd commented 5 years ago

Hi @doyaaaaaken , I will be able to check this PR on weekend.

rybalkinsd commented 5 years ago

as for now, targeting to 0.12.0 with this PR

doyaaaaaken commented 5 years ago

I simplified logic according to this comment (https://github.com/rybalkinsd/kohttp/pull/151#discussion_r317798695).

And as I said in the first comment (https://github.com/rybalkinsd/kohttp/pull/151#issue-307536896), below tasks are already left.

doyaaaaaken commented 5 years ago

I fixes code about this comment! https://github.com/rybalkinsd/kohttp/pull/151#discussion_r320482624

doyaaaaaken commented 5 years ago

All fixes are done, so I remove 'WIP'.