From 658a3b269a05b1554a662291fdc32aa357908f34 Mon Sep 17 00:00:00 2001 From: apoorvsadana <95699312+apoorvsadana@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:25:52 +0530 Subject: [PATCH] i32 -> u16 --- src/constants/indexers.rs | 4 ++-- src/publishers/indexers.rs | 2 +- src/publishers/mod.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/constants/indexers.rs b/src/constants/indexers.rs index 76a990e..1f3402b 100644 --- a/src/constants/indexers.rs +++ b/src/constants/indexers.rs @@ -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; diff --git a/src/publishers/indexers.rs b/src/publishers/indexers.rs index 040b18d..444c3f1 100644 --- a/src/publishers/indexers.rs +++ b/src/publishers/indexers.rs @@ -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(), diff --git a/src/publishers/mod.rs b/src/publishers/mod.rs index 41fc818..2088812 100644 --- a/src/publishers/mod.rs +++ b/src/publishers/mod.rs @@ -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(())