Fix compilation: add Debug derive and type annotations
Some checks failed
BotServer CI / build (push) Has been cancelled

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-03-09 19:32:36 -03:00
parent d22ce019b6
commit 5d3174b24e
2 changed files with 3 additions and 6 deletions

View file

@ -161,9 +161,7 @@ impl WhatsAppAdapter {
language_code: &str,
components: Vec<serde_json::Value>,
) -> Result<String, Box<dyn std::error::Error + Send + Sync>> {
// Wait for rate limiter before making API call
self.rate_limiter.acquire().await;
// Enqueue template message
let client = reqwest::Client::new();
let url = format!(

View file

@ -35,6 +35,7 @@ struct RecipientState {
burst_started: Option<Instant>,
}
#[derive(Debug)]
pub struct WhatsAppMessageQueue {
redis_client: redis::Client,
recipient_states: Arc<Mutex<HashMap<String, RecipientState>>>,
@ -58,7 +59,7 @@ impl WhatsAppMessageQueue {
let json = serde_json::to_string(&msg).map_err(|e| {
redis::RedisError::from((redis::ErrorKind::TypeError, "JSON serialization failed", e.to_string()))
})?;
conn.rpush(Self::QUEUE_KEY, json).await?;
conn.rpush::<_, _, ()>(Self::QUEUE_KEY, json).await?;
Ok(())
}
@ -143,8 +144,6 @@ impl WhatsAppMessageQueue {
burst_count: 0,
burst_started: None,
});
let now = Instant::now();
// Reset burst if window expired
if let Some(burst_start) = state.burst_started {