fut icon indicating copy to clipboard operation
fut copied to clipboard

Timeout

Open fifa2017player opened this issue 8 years ago • 6 comments

I noticed last night that for some reason a few requests made were just hanging for couple of hours for some reason, before an ExpiredSession gets raised. It would be great if when making requests to the server there is someway to specify a timeout, so that if the server just hangs, we don't wait indefinitely.

fifa2017player avatar Dec 19 '16 16:12 fifa2017player

I was sure requests has default timeout but looks like it's not set at all, thanks for pointing out.

oczkers avatar Dec 28 '16 10:12 oczkers

TODO:

  • make use of Timeout exception
  • some kind od retrying connection feature
  • use global timeout param when avaible (https://github.com/kennethreitz/requests/issues/3070)

oczkers avatar Dec 28 '16 10:12 oczkers

Thanks!

fifa2017player avatar Jan 10 '17 03:01 fifa2017player

I'll reopen this until todo is complete :-)

oczkers avatar Jan 10 '17 08:01 oczkers

@oczkers "some kind of retrying connection feature".

I do it in my bot catching exceptions and making it restart after 15 minutes for example. I'm able to do it, because I have the login information in my database, so, when I need to reconnect, I just have to connect to the database, retrieve login information and try again.

The API doesn't save login information (and it's right for doing it), so, how could it reconnnect when something interrupt the connection ?

converge avatar Jan 10 '17 12:01 converge

@converge

I do it in my bot catching exceptions and making it restart after 15 minutes for example.

I meant waiting x seconds and retrying for x times and if finally all that fails then throw exception. One bad request is definitely not enought to crash whole application.

oczkers avatar Jan 11 '17 21:01 oczkers