Skip to content

Commit

Permalink
i32 -> u16
Browse files Browse the repository at this point in the history
  • Loading branch information
apoorvsadana committed Oct 20, 2023
1 parent 5e0475b commit 658a3b2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/constants/indexers.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub const MAX_INDEXER_START_RETRIES: u32 = 3;
pub const WORKING_INDEXER_THRESHOLD_TIME_MINUTES: i64 = 5;
#[cfg(not(test))]
pub const START_INDEXER_DELAY_SECONDS: i32 = 120;
pub const START_INDEXER_DELAY_SECONDS: u16 = 120;
#[cfg(test)]
pub const START_INDEXER_DELAY_SECONDS: i32 = 0;
pub const START_INDEXER_DELAY_SECONDS: u16 = 0;
2 changes: 1 addition & 1 deletion src/publishers/indexers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::publishers::{send_sqs_message, send_sqs_message_with_delay};
use crate::types::sqs::{StartIndexerRequest, StopIndexerRequest};
use crate::utils::serde::serialize_request;

pub async fn publish_start_indexer(indexer_id: Uuid, attempt: u32, delay_seconds: i32) -> Result<(), IndexerError> {
pub async fn publish_start_indexer(indexer_id: Uuid, attempt: u32, delay_seconds: u16) -> Result<(), IndexerError> {
tracing::info!(
"Sending message to start indexer with id: {}, attempt: {}, delay_seconds: {}",
indexer_id.to_string(),
Expand Down
4 changes: 2 additions & 2 deletions src/publishers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ use aws_sdk_sqs::Error;

use crate::config::config;

async fn send_sqs_message_with_delay(queue_url: &str, message: &str, delay_seconds: i32) -> Result<(), Error> {
async fn send_sqs_message_with_delay(queue_url: &str, message: &str, delay_seconds: u16) -> Result<(), Error> {
let config = config().await;
config
.sqs_client()
.send_message()
.queue_url(queue_url)
.message_body(message)
.delay_seconds(delay_seconds)
.delay_seconds(delay_seconds.into())
.send()
.await?;
Ok(())
Expand Down

0 comments on commit 658a3b2

Please sign in to comment.