We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9070fd2 commit dc7eb6aCopy full SHA for dc7eb6a
src/lvmbeat/monitor.py
@@ -80,9 +80,13 @@ async def lifespan(app: FastAPI):
80
active = bool(int(data.split(",")[0]))
81
last_seen = data.split(",")[1]
82
83
- logger.info(f"Restoring state. active={active}, last_seen={last_seen}.")
84
- app.state.last_seen = last_seen if last_seen else None
+ app.state.last_seen = float(last_seen) if last_seen else None
85
app.state.active = active
+
86
+ logger.info(
87
+ f"Restoring state to active={app.state.active!r}, "
88
+ f"last_seen={timestamp_to_iso(app.state.last_seen)!r}."
89
+ )
90
except Exception as e:
91
logger.error(f"Could not read state file: {e}")
92
logger.error("Removing corrupted state file.")
0 commit comments