Cargo fix
This commit is contained in:
@@ -100,31 +100,31 @@ impl SmsApiClient {
|
||||
.timestamp();
|
||||
let end_ts = chrono::Utc::now().timestamp();
|
||||
|
||||
log::info!(
|
||||
"Fetching all historical messages for contact: {}",
|
||||
contact
|
||||
);
|
||||
log::info!("Fetching all historical messages for contact: {}", contact);
|
||||
|
||||
let mut all_messages = Vec::new();
|
||||
let mut offset = 0;
|
||||
let limit = 1000; // Fetch in batches of 1000
|
||||
|
||||
loop {
|
||||
log::debug!("Fetching batch at offset {} for contact {}", offset, contact);
|
||||
log::debug!(
|
||||
"Fetching batch at offset {} for contact {}",
|
||||
offset,
|
||||
contact
|
||||
);
|
||||
|
||||
let batch = self.fetch_messages_paginated(
|
||||
start_ts,
|
||||
end_ts,
|
||||
Some(contact),
|
||||
None,
|
||||
limit,
|
||||
offset
|
||||
).await?;
|
||||
let batch = self
|
||||
.fetch_messages_paginated(start_ts, end_ts, Some(contact), None, limit, offset)
|
||||
.await?;
|
||||
|
||||
let batch_size = batch.len();
|
||||
all_messages.extend(batch);
|
||||
|
||||
log::debug!("Fetched {} messages (total so far: {})", batch_size, all_messages.len());
|
||||
log::debug!(
|
||||
"Fetched {} messages (total so far: {})",
|
||||
batch_size,
|
||||
all_messages.len()
|
||||
);
|
||||
|
||||
// If we got fewer messages than the limit, we've reached the end
|
||||
if batch_size < limit {
|
||||
|
||||
Reference in New Issue
Block a user