Fix automatic unoserver restart
This commit is contained in:
parent
e31ccfee3a
commit
07f2f6f910
10
main.py
10
main.py
|
@ -4,6 +4,7 @@ import asyncio
|
|||
import subprocess
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import time
|
||||
|
||||
# api_id =
|
||||
#api_hash = ""
|
||||
|
@ -57,9 +58,12 @@ def unoCheck(): # Check if unoserver even exists
|
|||
def unoStart():
|
||||
unoserverPath = unoCheck()
|
||||
if unoserverPath:
|
||||
retval = 1
|
||||
while retval != 0:
|
||||
subprocess.Popen(args=[unoserverPath, "--daemon"])
|
||||
while True:
|
||||
process = subprocess.Popen(args=[unoserverPath, "--daemon"])
|
||||
retval = process.wait()
|
||||
if retval == 0:
|
||||
break
|
||||
time.sleep(1)
|
||||
else:
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in New Issue