4815162342lost / steam_gifts_bot

bot for http://www.steamgifts.com/
GNU General Public License v3.0
32 stars 6 forks source link

Script hangs indefinetly #16

Closed TheGoblinHero closed 2 years ago

TheGoblinHero commented 2 years ago

Sometimes the script randomly hangs. I suspect it happens when my internet connects\disconnects. Requests docs says this:

Timeouts You can tell Requests to stop waiting for a response after a given number of seconds with the timeout parameter. Nearly all production code should use this parameter in nearly all requests. Failure to do so can cause your program to hang indefinitely

I've added "timeout=120" in all occurrences of "requests.get". Lets see if it helps.

4815162342lost commented 2 years ago

Hello, thanks for your messages.

I added timeout option to all requests.get and requests.post functions: https://github.com/4815162342lost/steam_gifts_bot/commit/19918904b79df296c93f2e93f5c514f0b41a21d5