BUGFIG bot
- Doesn't close properly
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user