[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [doctor/master] Backoff when retrying urlopen requests
commit 40f9ed7249ae0f7f92f0908464169106fc24e2b5
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date: Sun Dec 17 13:03:00 2017 -0800
Backoff when retrying urlopen requests
The gentoo site in particular is pretty flaky. Doing some exponential backoff.
---
package_versions.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/package_versions.py b/package_versions.py
index 2ea5883..19503fe 100755
--- a/package_versions.py
+++ b/package_versions.py
@@ -10,6 +10,7 @@ Checks for outdated versions on the packages wiki...
import collections
import re
+import time
import urllib2
DEBIAN_VERSION = '<h1>Package: \S+ \(([0-9\.]+).*\)'
@@ -95,6 +96,9 @@ if __name__ == '__main__':
except Exception as exc:
request_exc = exc # note exception and retry
+ if i != 2:
+ time.sleep(2 ** i)
+
if request:
match = re.search(package.regex, request)
current_version = match.group(1) if match else None
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits