cleanup cli, configs, systemd and readme
This commit is contained in:
17
yastation.py
17
yastation.py
@@ -479,9 +479,20 @@ async def serve_daemon(args) -> int:
|
||||
raise RuntimeError("No stations found")
|
||||
|
||||
conns: Dict[str, StationConn] = {}
|
||||
for st in selected:
|
||||
conns[st.device_id] = StationConn(st, oauth, args.wait)
|
||||
await conns[st.device_id].start()
|
||||
try:
|
||||
for st in selected:
|
||||
conns[st.device_id] = StationConn(st, oauth, args.wait)
|
||||
await conns[st.device_id].start()
|
||||
except Exception as exc:
|
||||
for c in conns.values():
|
||||
try:
|
||||
await c.close()
|
||||
except Exception:
|
||||
pass
|
||||
msg = str(exc)
|
||||
if "AUTH_TOKEN_INVALID" in msg:
|
||||
raise RuntimeError("YANDEX_OAUTH_TOKEN invalid: update token and retry") from exc
|
||||
raise
|
||||
|
||||
async def resolve_conn(station_sel: str) -> Optional[StationConn]:
|
||||
station_sel = (station_sel or "").strip()
|
||||
|
||||
Reference in New Issue
Block a user