remove the unused reminder rollup request and the stale references to the stats page
This commit is contained in:
parent
6ed714a0a7
commit
37f036ee7d
1 changed files with 26 additions and 117 deletions
|
|
@ -60,8 +60,7 @@ fn socket_path() -> Option<PathBuf> {
|
|||
}
|
||||
|
||||
/// Dial this same in-agent socket from elsewhere IN THIS PROCESS — the
|
||||
/// harness's own `web_ui` endpoints (`api_todos`, `/api/stats` reminder
|
||||
/// rollup) and `Surface::post_turn_counts` all need read access to the
|
||||
/// harness's own `web_ui` endpoints (`api_todos`) and `Surface::post_turn_counts` all need read access to the
|
||||
/// `Todos`/`Reminders` stores this module owns behind an `Arc` on a
|
||||
/// different spawned task, and a loopback dial is simpler than threading
|
||||
/// those `Arc`s through every caller. One-shot, best-effort (no retry,
|
||||
|
|
@ -275,7 +274,6 @@ fn dispatch(
|
|||
Request::ListReminders => list_reminders(reminders),
|
||||
Request::CancelReminder { id } => cancel_reminder(reminders, id),
|
||||
Request::CountPendingReminders => count_pending_reminders(reminders),
|
||||
Request::ReminderRollup { since_secs } => reminder_rollup(reminders, since_secs),
|
||||
Request::Compact { wake_prompt } => compact(bus, wake_prompt),
|
||||
// Answered by `handle_conn` before this runs: it waits on the queue,
|
||||
// which this store-only function never does.
|
||||
|
|
@ -338,19 +336,6 @@ fn count_pending_reminders(reminders: Option<&Reminders>) -> Response {
|
|||
}
|
||||
}
|
||||
|
||||
/// `ReminderRollup` handler: scheduled/delivered/pending counts over a
|
||||
/// trailing `since_secs` window (`0` = all time).
|
||||
fn reminder_rollup(reminders: Option<&Reminders>, since_secs: u64) -> Response {
|
||||
let Some(r) = reminders else {
|
||||
return no_reminders_store();
|
||||
};
|
||||
let since_secs = i64::try_from(since_secs).unwrap_or(i64::MAX);
|
||||
match r.rollup(since_secs) {
|
||||
Ok(stats) => Response::ReminderRollup { stats },
|
||||
Err(e) => err(&e),
|
||||
}
|
||||
}
|
||||
|
||||
/// `UpsertTodo` handler: writes/refreshes a todo row, logs the outcome, and
|
||||
/// fires `wake` on a new-or-changed upsert so the serve loop runs a turn.
|
||||
fn upsert_todo(
|
||||
|
|
@ -890,7 +875,6 @@ mod tests {
|
|||
Request::ListReminders,
|
||||
Request::CancelReminder { id: 1 },
|
||||
Request::CountPendingReminders,
|
||||
Request::ReminderRollup { since_secs: 0 },
|
||||
];
|
||||
for req in reqs {
|
||||
let resp = dispatch(req, &todos, &wake, None, &bus);
|
||||
|
|
@ -924,10 +908,6 @@ mod tests {
|
|||
panic!("one reminder, got {loose_ends:?}");
|
||||
};
|
||||
assert_eq!(message, "check the deploy");
|
||||
assert!(matches!(
|
||||
run(Request::ReminderRollup { since_secs: 0 }),
|
||||
Response::ReminderRollup { .. }
|
||||
));
|
||||
|
||||
assert_eq!(acked(&run(Request::CancelReminder { id: *id })), 1);
|
||||
assert_eq!(acked(&run(Request::CancelReminder { id: *id })), 0);
|
||||
|
|
@ -1150,7 +1130,6 @@ mod tests {
|
|||
Request::ListReminders,
|
||||
Request::CancelReminder { id: 1 },
|
||||
Request::CountPendingReminders,
|
||||
Request::ReminderRollup { since_secs: 0 },
|
||||
];
|
||||
for req in requests {
|
||||
let label = format!("{req:?}");
|
||||
|
|
|
|||
Loading…
Reference in a new issue