From aaa058a1f17b45dff1443d352ee84904a7091f06 Mon Sep 17 00:00:00 2001 From: nikola-bozin-org Date: Sat, 11 May 2024 11:16:17 +0200 Subject: [PATCH] fix: removed mutex --- docker-compose.yml | 2 +- server/src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1ac2da5..86ca684 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: POSTGRES_DB: ${POSTGRES_DB} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} ports: - - "5432:5432" + - "5430:5432" volumes: - ./docker-volumes/postgres-wisdomia-monolithic-volume:/var/lib/postgresql/data networks: diff --git a/server/src/main.rs b/server/src/main.rs index e7fb774..9753e04 100755 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -12,7 +12,7 @@ use std::{env, net::SocketAddr, sync::Arc}; use axum::{middleware, Extension, Router}; use middlewares::response_mapper; -use tokio::{net::TcpListener, sync::Mutex}; +use tokio::net::TcpListener; use crate::{ constants::{REQUESTS_AMOUNT_LIMIT, REQUESTS_AMOUNT_TIME_FRAME}, @@ -50,7 +50,7 @@ async fn main() { rate_limiter_config, }; - let shared_state = Arc::new(Mutex::new(state)); + let shared_state = Arc::new(state); let listener = TcpListener::bind(format!("{}:{}", constants::HOST, constants::PORT)) .await