fix(#937): drop dead has_pending_from — superseded by has_pending_with_body
This commit is contained in:
parent
3283362b36
commit
8d2ae047b1
1 changed files with 0 additions and 15 deletions
|
|
@ -263,21 +263,6 @@ impl Broker {
|
||||||
Ok(u64::try_from(n.max(0)).unwrap_or(0))
|
Ok(u64::try_from(n.max(0)).unwrap_or(0))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true when the recipient already has at least one
|
|
||||||
/// undelivered message from `sender` in the broker. Used by the
|
|
||||||
/// scheduler to avoid piling up repeated prompts when an agent is
|
|
||||||
/// slow or was briefly offline.
|
|
||||||
pub fn has_pending_from(&self, recipient: &str, sender: &str) -> Result<bool> {
|
|
||||||
let conn = self.conn.lock().unwrap();
|
|
||||||
let n: i64 = conn.query_row(
|
|
||||||
"SELECT COUNT(*) FROM messages
|
|
||||||
WHERE recipient = ?1 AND sender = ?2 AND delivered_at IS NULL",
|
|
||||||
params![recipient, sender],
|
|
||||||
|row| row.get(0),
|
|
||||||
)?;
|
|
||||||
Ok(n > 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns true when the recipient already has at least one
|
/// Returns true when the recipient already has at least one
|
||||||
/// undelivered message from `sender` with exactly `body` in the
|
/// undelivered message from `sender` with exactly `body` in the
|
||||||
/// broker. Used by the scheduler to skip re-delivery of the same
|
/// broker. Used by the scheduler to skip re-delivery of the same
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue