Skip to content

Commit e47d8b1

Browse files
Added Makefile, resolved shutdown() not terminating thread issue
1 parent 0fba34f commit e47d8b1

5 files changed

Lines changed: 14 additions & 9 deletions

File tree

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
release:
2+
python3 setup.py sdist bdist_wheel
3+
twine upload dist/*
4+
5+
install:
6+
python3 setup.py sdist bdist_wheel
7+
pip3 install -e .
8+
9+
.PHONY: release install
10+
11+

setup.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
from track.version import VERSION # noqa
1313

1414

15-
# 'setup.py publish' shortcut
16-
if sys.argv[-1] == 'publish':
17-
os.system('python3 setup.py sdist bdist_wheel')
18-
os.system('twine upload dist/*')
19-
sys.exit()
20-
2115
# TODO: update long description in README.md
2216
with open(file='README.md', mode='r', encoding='utf-8') as f:
2317
readme = f.read()

track/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def flush(self):
8080
size = queue.qsize()
8181
queue.join()
8282
# Note that this message may not be precise, because of threading.
83-
self.logger.debug('successfully flushed about %s items.', size)
83+
self.logger.debug('Successfully flushed about %s items.', size)
8484

8585
def join(self):
8686
"""Ends the consumer thread once the queue is empty.

track/consumer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def upload(self):
4040
queue = self.queue
4141
queue_msg = None
4242
try:
43-
queue_msg = queue.get(block=True)
43+
queue_msg = queue.get(block=True, timeout=1)
4444
except Empty:
4545
self.logger.debug("queue is empty now")
4646

track/request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ def __init__(self, status, code, message):
4343
self.code = code
4444

4545
def __str__(self):
46-
msg = "[interakt-track] {0}: {1} ({2})"
46+
msg = "[interakt-track] StatusCode({0}): {1} (Success={2})"
4747
return msg.format(self.code, self.message, self.status)

0 commit comments

Comments
 (0)