Add reset option to /incidents_diff
This commit is contained in:
@@ -399,11 +399,19 @@ async def incidents_diff(msg: Message):
|
||||
return
|
||||
parts = msg.text.split()
|
||||
hours = 24
|
||||
reset = False
|
||||
if len(parts) >= 2:
|
||||
if parts[1].lower() in {"reset", "clear"}:
|
||||
reset = True
|
||||
else:
|
||||
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_dt = None
|
||||
if isinstance(last_iso, str):
|
||||
|
||||
Reference in New Issue
Block a user