Fixed connecting state assignment bug
This commit is contained in:
6
main.py
6
main.py
@@ -148,13 +148,14 @@ def findDiskNode(serial: str) -> str | None:
|
||||
|
||||
|
||||
def mountDisk(state: AppState) -> None:
|
||||
state.diskState = "connecting"
|
||||
node = findDiskNode(state.config.diskSerial)
|
||||
try:
|
||||
subprocess.run(
|
||||
["mkdir", "-p", f"/mnt/{state.config.diskSerial}"],
|
||||
check=True,
|
||||
)
|
||||
sleep(2)
|
||||
sleep(1)
|
||||
subprocess.run(
|
||||
[
|
||||
"mount",
|
||||
@@ -165,7 +166,7 @@ def mountDisk(state: AppState) -> None:
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
sleep(2)
|
||||
sleep(1)
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
else:
|
||||
@@ -233,7 +234,6 @@ def main() -> None:
|
||||
and event.event == "connected"
|
||||
and event.serial == state.config.diskSerial
|
||||
):
|
||||
state.diskState == "connecting"
|
||||
mountDisk(state)
|
||||
|
||||
except Empty:
|
||||
|
||||
Reference in New Issue
Block a user