You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ro...@apache.org on 2012/08/03 21:50:54 UTC

svn commit: r1369185 - /incubator/ooo/devtools/aoo-stats/get-aoo-stats.py

Author: robweir
Date: Fri Aug  3 19:50:53 2012
New Revision: 1369185

URL: http://svn.apache.org/viewvc?rev=1369185&view=rev
Log:
Add logic to retry in case of network I/O errors

Modified:
    incubator/ooo/devtools/aoo-stats/get-aoo-stats.py

Modified: incubator/ooo/devtools/aoo-stats/get-aoo-stats.py
URL: http://svn.apache.org/viewvc/incubator/ooo/devtools/aoo-stats/get-aoo-stats.py?rev=1369185&r1=1369184&r2=1369185&view=diff
==============================================================================
--- incubator/ooo/devtools/aoo-stats/get-aoo-stats.py (original)
+++ incubator/ooo/devtools/aoo-stats/get-aoo-stats.py Fri Aug  3 19:50:53 2012
@@ -37,9 +37,22 @@ from urllib import urlencode
 def getSourceForgeStats(download,date):
 
     url = download + "/stats/json?start_date=" + date + "&" "end_date=" + date
-    
-    return urllib.urlopen(url).read()
 
+    attempts = 0
+
+    while attempts < 3:
+        try:    
+            conn = urllib.urlopen(url)
+            data = conn.read()
+            
+            return data
+
+        except:
+            attempts += 1
+            print "error " + str(attempts)
+
+    return ""
+    
 
 if len(sys.argv) == 0:
     print "syntax:  python get-aoo-stats.py <urls.lst> <iso-date>"