mirror of
https://github.com/titanscouting/tra-superscript.git
synced 2024-11-10 06:54:45 +00:00
added Pool.join to allow threads to exit safely
added keyboard interrupt signal ignore in threads
Former-commit-id: 836e9ca6be
This commit is contained in:
parent
3c7262498c
commit
7e800c9004
@ -4,8 +4,12 @@ from tra_analysis import Analysis as an
|
|||||||
from dataset import push_metric
|
from dataset import push_metric
|
||||||
from data import pull_new_tba_matches
|
from data import pull_new_tba_matches
|
||||||
|
|
||||||
|
import signal
|
||||||
|
|
||||||
def simplestats(data_test):
|
def simplestats(data_test):
|
||||||
|
|
||||||
|
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
||||||
|
|
||||||
data = np.array(data_test[0])
|
data = np.array(data_test[0])
|
||||||
data = data[np.isfinite(data)]
|
data = data[np.isfinite(data)]
|
||||||
ranges = list(range(len(data)))
|
ranges = list(range(len(data)))
|
||||||
|
@ -357,6 +357,7 @@ def main():
|
|||||||
log(stdout, INF, "detected KeyboardInterrupt, killing threads")
|
log(stdout, INF, "detected KeyboardInterrupt, killing threads")
|
||||||
if "exec_threads" in locals():
|
if "exec_threads" in locals():
|
||||||
exec_threads.terminate()
|
exec_threads.terminate()
|
||||||
|
exec_threads.join()
|
||||||
exec_threads.close()
|
exec_threads.close()
|
||||||
log(stdout, INF, "terminated threads, exiting")
|
log(stdout, INF, "terminated threads, exiting")
|
||||||
loop_stored_exception = sys.exc_info()
|
loop_stored_exception = sys.exc_info()
|
||||||
|
Loading…
Reference in New Issue
Block a user