[depictor/master] Add a timeout to the clock skew request

18 Dec
2020
18 Dec
'20
6:56 p.m.
commit 3355279b34a3e21c64cd61fc81b5eb7566a0d895 Author: Tom Ritter <tom@ritter.vg> Date: Fri Dec 18 12:55:56 2020 -0600 Add a timeout to the clock skew request --- utility.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utility.py b/utility.py index 7b35f00..390cebf 100755 --- a/utility.py +++ b/utility.py @@ -112,7 +112,7 @@ def get_clockskew(): try: startTimeStamp = datetime.datetime.utcnow() startTime = time.time() - f = urllib.request.urlopen(authority_address) + f = urllib.request.urlopen(authority_address, timeout=30) h = f.getheader('date') if h: clockskew[nickname] = datetime.datetime.strptime(h, '%a, %d %b %Y %H:%M:%S %Z')
1614
Age (days ago)
1614
Last active (days ago)
0 comments
1 participants
participants (1)
-
tom@torproject.org