autocommit

This commit is contained in:
ALIHAN DIKEL
2024-10-30 00:22:41 +03:00
parent 68cebd844b
commit cd7f011277
2 changed files with 2 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ def release_and_renew(timeout=20):
renew_process = subprocess.run(renew_cmd, capture_output=True, text=True, timeout=timeout)
# renew wlan0 so default gateway issue is fixed (issue: broken internet connection for ui and all)
renew_cmd[-1] = "wlan0"
print(renew_cmd)
subprocess.run(renew_cmd, timeout=timeout)
result_info["release_stderr"] = release_process.stderr

View File

@@ -26,10 +26,10 @@ import os
async def maintain_connection_to_tello(state):
state["connection"] = "NOK"
await asyncio.to_thread(nmcli.connection.reload)
while True:
await asyncio.sleep(0.5)
if state["connection"] == "NOK":
await asyncio.to_thread(nmcli.connection.reload)
resp = await asyncio.to_thread(release_and_renew, 20)
if resp["status"] == "done":
if await asyncio.to_thread(check_dhcp_ip, resp["renew_stderr"]):