From f06f156f35e21e7ef0734113e4eebc26d2ead092 Mon Sep 17 00:00:00 2001 From: Nico <60229704+Marchand-Nicolas@users.noreply.github.com> Date: Wed, 4 Sep 2024 12:12:39 +0200 Subject: [PATCH 1/2] fix: discord fw callback --- src/endpoints/quests/discord_fw_callback.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/endpoints/quests/discord_fw_callback.rs b/src/endpoints/quests/discord_fw_callback.rs index 80eed6a..43be037 100644 --- a/src/endpoints/quests/discord_fw_callback.rs +++ b/src/endpoints/quests/discord_fw_callback.rs @@ -36,8 +36,7 @@ pub async fn handler( State(state): State>, Query(query): Query, ) -> impl IntoResponse { - let conf = config::load(); - let logger = Logger::new(&conf.watchtower); + let logger = state.logger.clone(); // the state is in format => "address+quest_id+task_id" let state_split = query.state.split('+').collect::>(); let quest_id = state_split[1].parse::().unwrap(); From d1f8b22132383126da3175773a1dd2dca837aeca Mon Sep 17 00:00:00 2001 From: Nico <60229704+Marchand-Nicolas@users.noreply.github.com> Date: Tue, 10 Sep 2024 11:15:22 +0200 Subject: [PATCH 2/2] using ref insteaf of cloning --- src/endpoints/quests/discord_fw_callback.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/endpoints/quests/discord_fw_callback.rs b/src/endpoints/quests/discord_fw_callback.rs index 43be037..e16df32 100644 --- a/src/endpoints/quests/discord_fw_callback.rs +++ b/src/endpoints/quests/discord_fw_callback.rs @@ -36,7 +36,7 @@ pub async fn handler( State(state): State>, Query(query): Query, ) -> impl IntoResponse { - let logger = state.logger.clone(); + let logger = &state.logger; // the state is in format => "address+quest_id+task_id" let state_split = query.state.split('+').collect::>(); let quest_id = state_split[1].parse::().unwrap();