Added force stop

This commit is contained in:
bytedream 2022-01-31 20:11:41 +01:00
parent e396cf51f1
commit c425b973a0

View File

@ -135,7 +135,12 @@ def v1():
PingRequester('192.168.2.1', 'data/192-168-2-1.csv')
]
sig_received = False
def stop(sig, frame):
if sig_received:
exit(1)
print("Stopping threads gratefully (may take up to 60 seconds)")
for thread in threads:
thread.finish()
@ -155,6 +160,9 @@ def v2():
'1.1.1.1', '217.237.148.22', '192.168.2.1')
def stop(sig, frame):
if ping.stop:
exit(1)
print("Stopping process gratefully (may take up to 60 seconds)")
ping.finish()