Attempt to set a 20 second timeout on searches
authorMagnus Hagander <magnus@hagander.net>
Sat, 12 Jan 2013 17:11:38 +0000 (18:11 +0100)
committerMagnus Hagander <magnus@hagander.net>
Sat, 12 Jan 2013 17:11:38 +0000 (18:11 +0100)
pgweb/search/views.py

index 30d7aa8695f33d1f42a05dc00319f2e60d20da56..45c5efa7d61d1ce074413b078935f2108b249b9a 100644 (file)
@@ -178,6 +178,7 @@ def search(request):
                        # No hits found - so try to get them from the search server
                        c = httplib.HTTPConnection(settings.ARCHIVES_SEARCH_SERVER, strict=True, timeout=5)
                        c.request('POST', '/archives-search/', urlstr)
+                       c.sock.settimeout(20) # Set a 20 second timeout
                        r = c.getresponse()
                        if r.status != 200:
                                memc = None