diff --git a/src/core/bot/channels/whatsapp.rs b/src/core/bot/channels/whatsapp.rs index ab139c63..da0bf044 100644 --- a/src/core/bot/channels/whatsapp.rs +++ b/src/core/bot/channels/whatsapp.rs @@ -161,9 +161,7 @@ impl WhatsAppAdapter { language_code: &str, components: Vec, ) -> Result> { - // Wait for rate limiter before making API call - self.rate_limiter.acquire().await; - + // Enqueue template message let client = reqwest::Client::new(); let url = format!( diff --git a/src/core/bot/channels/whatsapp_queue.rs b/src/core/bot/channels/whatsapp_queue.rs index e1a877bf..29d1b2b8 100644 --- a/src/core/bot/channels/whatsapp_queue.rs +++ b/src/core/bot/channels/whatsapp_queue.rs @@ -35,6 +35,7 @@ struct RecipientState { burst_started: Option, } +#[derive(Debug)] pub struct WhatsAppMessageQueue { redis_client: redis::Client, recipient_states: Arc>>, @@ -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 {