Add reset option to /incidents_diff
This commit is contained in:
@@ -399,11 +399,19 @@ async def incidents_diff(msg: Message):
|
|||||||
return
|
return
|
||||||
parts = msg.text.split()
|
parts = msg.text.split()
|
||||||
hours = 24
|
hours = 24
|
||||||
|
reset = False
|
||||||
if len(parts) >= 2:
|
if len(parts) >= 2:
|
||||||
try:
|
if parts[1].lower() in {"reset", "clear"}:
|
||||||
hours = max(1, int(parts[1]))
|
reset = True
|
||||||
except ValueError:
|
else:
|
||||||
hours = 24
|
try:
|
||||||
|
hours = max(1, int(parts[1]))
|
||||||
|
except ValueError:
|
||||||
|
hours = 24
|
||||||
|
if reset:
|
||||||
|
runtime_state.set_state("incidents_diff_last_ts", None)
|
||||||
|
await msg.answer("📣 Diff marker reset. Next run will show all within window.", reply_markup=system_logs_audit_kb)
|
||||||
|
return
|
||||||
last_iso = runtime_state.get("incidents_diff_last_ts")
|
last_iso = runtime_state.get("incidents_diff_last_ts")
|
||||||
last_dt = None
|
last_dt = None
|
||||||
if isinstance(last_iso, str):
|
if isinstance(last_iso, str):
|
||||||
|
|||||||
Reference in New Issue
Block a user