[Pywikipedia-svn] SVN: [7235] trunk/pywikipedia/query.py

filnik at svn.wikimedia.org filnik at svn.wikimedia.org
Sun Sep 13 10:27:15 UTC 2009


Revision: 7235
Author:   filnik
Date:     2009-09-13 10:27:15 +0000 (Sun, 13 Sep 2009)

Log Message:
-----------
Bugfix by xqt to bug: #2829439

Modified Paths:
--------------
    trunk/pywikipedia/query.py

Modified: trunk/pywikipedia/query.py
===================================================================
--- trunk/pywikipedia/query.py	2009-09-13 10:11:38 UTC (rev 7234)
+++ trunk/pywikipedia/query.py	2009-09-13 10:27:15 UTC (rev 7235)
@@ -81,7 +81,7 @@
             wikipedia.output(u"Request %s:%s" % (site.lang, path))
 
     lastError = None
-    retry_idle_time = 5
+    retry_idle_time = 1
 
     while retryCount >= 0:
         try:
@@ -110,17 +110,19 @@
             retryCount -= 1
             wikipedia.output(u"Error downloading data: %s" % error)
             wikipedia.output(u"Request %s:%s" % (site.lang, path))
-            wikipedia.debugDump('ApiGetDataParse', site, str(error) + '\n%s\n%s' % (site.hostname(), path), jsontext)
             lastError = error
             if retryCount >= 0:
-                wikipedia.output(u"Retrying in %i seconds..." % retry_idle_time)
-                time.sleep(retry_idle_time)
+                wikipedia.output(u"Retrying in %i minutes..." % retry_idle_time)
+                time.sleep(retry_idle_time*60)
                 # Next time wait longer, but not longer than half an hour
                 retry_idle_time *= 2
-                if retry_idle_time > 300:
-                    retry_idle_time = 300
+                if retry_idle_time > 30:
+                    retry_idle_time = 30
+            else:
+                wikipedia.debugDump('ApiGetDataParse', site, str(error) + '\n%s\n%s' % (site.hostname(), path), jsontext)
 
 
+
     raise lastError
 
 def GetInterwikies(site, titles, extraParams = None ):





More information about the Pywikipedia-svn mailing list