KeithCu / LinuxReport

Customizable Linux news site based on Python / Flask
https://covidreport.keithcu.com/
GNU Lesser General Public License v3.0
10 stars 2 forks source link

Add timeout #17

Closed KeithCu closed 4 years ago

KeithCu commented 4 years ago

This request hanged: https://www.google.com/alerts/feeds/12151242449143161443/16985802477674969984

That means that anyone fetching a page will never return either.

It seems to be working again now, but it would be nice to have some socket timeout logic of 5 seconds or so max.

Also, I could have some logic to temporarily cache an empty feedparser result so that anyone who was waiting could just use that value and not block the whole site.

KeithCu commented 4 years ago

Added a 5 second timeout value. Let's see how it works over time.

KeithCu commented 4 years ago

I've tested it and it will now just return an empty result set and not block the whole site for minutes.