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
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import shutil
|
import shutil
|
||||||
|
import time
|
||||||
|
|
||||||
# api_id =
|
# api_id =
|
||||||
#api_hash = ""
|
#api_hash = ""
|
||||||
|
@ -57,9 +58,12 @@ def unoCheck(): # Check if unoserver even exists
|
||||||
def unoStart():
|
def unoStart():
|
||||||
unoserverPath = unoCheck()
|
unoserverPath = unoCheck()
|
||||||
if unoserverPath:
|
if unoserverPath:
|
||||||
retval = 1
|
while True:
|
||||||
while retval != 0:
|
process = subprocess.Popen(args=[unoserverPath, "--daemon"])
|
||||||
subprocess.Popen(args=[unoserverPath, "--daemon"])
|
retval = process.wait()
|
||||||
|
if retval == 0:
|
||||||
|
break
|
||||||
|
time.sleep(1)
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue