incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robw...@apache.org
Subject svn commit: r1369185 - /incubator/ooo/devtools/aoo-stats/get-aoo-stats.py
Date Fri, 03 Aug 2012 19:50:54 GMT
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>"



Mime
View raw message