Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implemented an overall timeout for fetching data.

This doesn't work for servers which drip data slowly.
  • Loading branch information...
commit f0af5f94ce3564dec10d282cbab1a61e36c338be 1 parent 1fc38cb
@nibrahim nibrahim authored
Showing with 4 additions and 3 deletions.
  1. +3 −2 config.yml
  2. +1 −1  liveweb/arc_proxy.py
View
5 config.yml
@@ -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
2  liveweb/arc_proxy.py
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.