imobanco / bb-wrapper

https://pypi.org/project/bb-wrapper/
GNU General Public License v3.0
8 stars 1 forks source link

Corrige erro de conexão "Connection reset by peer" #51

Closed brenomfviana closed 1 year ago

brenomfviana commented 1 year ago

Resumo

Relacionado aos issues/prs:

Algumas requisições a APIs de terceiros resultaram em erros de conexão com a seguinte mensagem: "Connection reset by peer".

Este PR corrige esse erro adicionando o decorator retry_request, com sleep de 0.01 segundos, para que a comunicação com a API BB seja reestabelecida.

Alterações de models

Alterações de services

Alterações de wrappers

Adiciona decorator retry_request para os métodos http da classe RequestWrapper.

PedroRegisPOAR commented 1 year ago

Deu erro no coverage :eyes:

codecov[bot] commented 1 year ago

Codecov Report

Merging #51 (e9b0e41) into main (25e0be1) will increase coverage by 0.45%. The diff coverage is 100.00%.

:exclamation: Current head e9b0e41 differs from pull request most recent head 8917425. Consider uploading reports for the commit 8917425 to get more accurate results

Additional details and impacted files [![Impacted file tree graph](https://codecov.io/gh/imobanco/bb-wrapper/pull/51/graphs/tree.svg?width=650&height=150&src=pr&token=xAQaCbhGUv&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=imobanco)](https://codecov.io/gh/imobanco/bb-wrapper/pull/51?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=imobanco) ```diff @@ Coverage Diff @@ ## main #51 +/- ## ========================================== + Coverage 88.08% 88.53% +0.45% ========================================== Files 23 23 Lines 990 1012 +22 ========================================== + Hits 872 896 +24 + Misses 118 116 -2 ``` | [Impacted Files](https://codecov.io/gh/imobanco/bb-wrapper/pull/51?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=imobanco) | Coverage Δ | | |---|---|---| | [bb\_wrapper/wrapper/request.py](https://codecov.io/gh/imobanco/bb-wrapper/pull/51/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=imobanco#diff-YmJfd3JhcHBlci93cmFwcGVyL3JlcXVlc3QucHk=) | `81.13% <100.00%> (+7.32%)` | :arrow_up: | | [Impacted Files](https://codecov.io/gh/imobanco/bb-wrapper/pull/51?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=imobanco) | Coverage Δ | | |---|---|---| | [bb\_wrapper/wrapper/request.py](https://codecov.io/gh/imobanco/bb-wrapper/pull/51/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=imobanco#diff-YmJfd3JhcHBlci93cmFwcGVyL3JlcXVlc3QucHk=) | `81.13% <100.00%> (+7.32%)` | :arrow_up: |