Permalink
Browse files

Implemented an overall timeout for fetching data.

This doesn't work for servers which drip data slowly.
  • Loading branch information...
1 parent 1fc38cb commit f0af5f94ce3564dec10d282cbab1a61e36c338be @nibrahim nibrahim committed Apr 19, 2012
Showing with 4 additions and 3 deletions.
  1. +3 −2 config.yml
  2. +1 −1 liveweb/arc_proxy.py
View
@@ -12,6 +12,7 @@ expire_time: 3600
# port: 6379
# db: 0
-# All timeouts specified in seconds
-dns_timeout: 5 # Timeout for the initial DNS lookup and HTTP connection
+# Maximum amount of time for a URL to be downloaded
+timeout: 10
+
View
@@ -91,7 +91,7 @@ def establish_connection(url):
logging.debug("Attempting to fetch '%s' from '%s'", resource, server)
try:
- conn = httplib.HTTPConnection(server, timeout = int(config.dns_timeout))
+ conn = httplib.HTTPConnection(server, timeout = int(config.timeout))
except httplib.InvalidURL:
raise BadURL("'%s' is an invalid URL", url)

0 comments on commit f0af5f9

Please sign in to comment.