(&mut self, id: u64)
| 98 | } |
| 99 | |
| 100 | pub async fn ack_triggered_task(&mut self, id: u64) { |
| 101 | if let Some(index) = |
| 102 | self.pending |
| 103 | .iter() |
| 104 | .enumerate() |
| 105 | .find_map(|(i, v)| if *v == id { Some(i) } else { None }) |
| 106 | { |
| 107 | self.pending.swap_remove(index); |
| 108 | } |
| 109 | |
| 110 | loop { |
| 111 | match self.storage.del_task_by_id(self.guild_id, id).await { |
| 112 | Ok(_) => return, |
| 113 | Err(err) => { |
| 114 | error!(%err, "failed deleting task"); |
| 115 | tokio::time::sleep(std::time::Duration::from_secs(5)).await; |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | // pub async fn failed_ack_pending(&mut self, id: u64) { |
| 122 | // if let Some(index) = |
no test coverage detected