Skip to content

Commit 4428cb5

Browse files
authored
Merge pull request #128 from hyperdashio/sc-threading-timeouts
Use TIMEOUT_MAX for threading timeouts
2 parents c7b2952 + 3b90ef7 commit 4428cb5

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

hyperdash/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.15.2
1+
0.15.3

hyperdash_cli/cli.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from .constants import get_base_url
3535
from .constants import get_base_http_url
3636
from .constants import GITHUB_OAUTH_START
37-
from .constants import ONE_YEAR_IN_SECONDS
37+
from .constants import THREADING_TIMEOUT_MAX
3838
from .constants import LOOPBACK
3939

4040

@@ -231,18 +231,18 @@ def manual_entry():
231231
# user's browser to prevent a race condition where the Hyperdash server
232232
# redirects with an access token but the Python server isn't ready yet.
233233
#
234-
# Also, we set the timeout to ONE_YEAR_IN_SECONDS because without a timeout,
234+
# Also, we set the timeout to THREADING_TIMEOUT_MAX because without a timeout,
235235
# the .get() call on the queue can not be interrupted with CTRL+C.
236-
server_started_queue.get(block=True, timeout=ONE_YEAR_IN_SECONDS)
237-
manual_entry_thread_started_queue.get(block=True, timeout=ONE_YEAR_IN_SECONDS)
236+
server_started_queue.get(block=True, timeout=THREADING_TIMEOUT_MAX)
237+
manual_entry_thread_started_queue.get(block=True, timeout=THREADING_TIMEOUT_MAX)
238238
# Blocks until browser opens, but doesn't wait for user to close it
239239
webbrowser.open_new_tab(auto_login_url)
240240

241241

242242
# Wait for the Hyperdash server to redirect with the access token to our embedded
243243
# server, or for the user to manually enter an access token. Whichever happens
244244
# first.
245-
access_token = access_token_queue.get(block=True, timeout=ONE_YEAR_IN_SECONDS)
245+
access_token = access_token_queue.get(block=True, timeout=THREADING_TIMEOUT_MAX)
246246
# Use the access token to retrieve the user's API key and store a valid
247247
# hyperdash.json file
248248
success, default_api_key = _after_access_token_login(access_token)

hyperdash_cli/constants.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
GITHUB_OAUTH_START = "oauth/github/start"
77

8-
ONE_YEAR_IN_SECONDS = 365 * 24 * 60 * 60
8+
THREADING_TIMEOUT_MAX = 4294967 # Maximum allowed threading.TIMEOUT_MAX in Python 3.6
99

1010
LOOPBACK = "127.0.0.1"
1111

requirements_dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ nose==1.3.7
33
requests==2.18.1
44
six==1.10.0
55
wheel==0.24.0
6+
tornado>=4.0.0,<5.0.0
67
jupyter==1.0.0
78
python-slugify==1.2.4
89
twine==1.9.1

0 commit comments

Comments
 (0)