BUGFIG bot

- Doesn't close properly
This commit is contained in:
Logan Cusano
2022-02-18 01:48:19 -05:00
parent d288d067fe
commit 4a9cdefa4a

View File

@@ -1,5 +1,6 @@
import threading
import subprocess
import time
import os
@@ -37,6 +38,14 @@ class OP25Handler(threading.Thread):
print(f"Closing OP25")
try:
self.OP25Proc.kill()
self.OP25Proc.terminate()
seconds_waited = 0
while self.OP25Proc.poll() is None:
# Terminate the process every 5 seconds
if seconds_waited % 5 == 0:
self.OP25Proc.terminate()
time.sleep(1)
seconds_waited += 1
except Exception as e:
print(e)