revise bulk-clear to explicit ids per mara's feedback, fix clippy line count
This commit is contained in:
parent
eb570c003d
commit
bc69ee3b8f
7 changed files with 228 additions and 181 deletions
|
|
@ -202,7 +202,7 @@ fn dispatch(
|
|||
} => clear_todo(store, &subsystem, key.as_deref(), all),
|
||||
Request::ListTodos { subsystem } => list_todos(store, subsystem.as_deref()),
|
||||
Request::MarkTodoDone { id } => mark_todo_done(store, id),
|
||||
Request::MarkTodosDoneUntil { up_to } => mark_todos_done_until(store, up_to),
|
||||
Request::MarkTodosDone { ids } => mark_todos_done(store, &ids),
|
||||
Request::StoreReminder {
|
||||
message,
|
||||
timing,
|
||||
|
|
@ -418,13 +418,13 @@ fn mark_todo_done(store: &Todos, id: i64) -> Response {
|
|||
}
|
||||
}
|
||||
|
||||
/// `MarkTodosDoneUntil` handler: bulk-acks every un-acked todo id at or
|
||||
/// below `up_to` — the escape hatch for a backlog too large to triage
|
||||
/// one-by-one (see `Todos::mark_done_until`'s doc for why it's needed).
|
||||
fn mark_todos_done_until(store: &Todos, up_to: i64) -> Response {
|
||||
match store.mark_done_until(up_to) {
|
||||
/// `MarkTodosDone` handler: bulk-acks an explicit list of todo ids — the
|
||||
/// escape hatch for a backlog too large to triage one-by-one (see
|
||||
/// `Todos::mark_done_many`'s doc for why it's ids, not a threshold).
|
||||
fn mark_todos_done(store: &Todos, ids: &[i64]) -> Response {
|
||||
match store.mark_done_many(ids) {
|
||||
Ok(count) => {
|
||||
tracing::debug!(up_to, count, "todo bulk mark-done");
|
||||
tracing::debug!(n_ids = ids.len(), count, "todo bulk mark-done");
|
||||
Response::Acked {
|
||||
count: u64::try_from(count).unwrap_or(0),
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue