This commit is contained in:
Max Hunt 2020-02-10 17:30:47 +00:00
parent c9eec70547
commit f355682342

10
main.py
View File

@ -353,9 +353,11 @@ def _tf_service_initializer():
def tf_service(init=True):
if init:
print('Starting tf service thread')
tf_service_thread = threading.Thread(target=_tf_service_initializer)
tf_service_thread.start()
else:
print('Killing tf service thread')
tf_service_thread.kill()
@ -458,11 +460,11 @@ tf_service(init=True)
try:
print('Done with task, waiting to kill tf service')
print('Done with task, enter x to kill tf service')
while True:
time.sleep(0.1)
except KeyboardInterrupt:
print("KeyboardInterrupt has been caught., killing tf service")
a = raw_input()
if a == 'x' or x == 'X':
print("x has been caught, killing tf service")
tf_service(init=False)
print("Done, exiting")