diff --git a/src/dispatching/dialogue/storage/trace_storage.rs b/src/dispatching/dialogue/storage/trace_storage.rs index 69acd5a2..f828711c 100644 --- a/src/dispatching/dialogue/storage/trace_storage.rs +++ b/src/dispatching/dialogue/storage/trace_storage.rs @@ -1,9 +1,9 @@ -use std::{fmt::Debug, sync::Arc}; +use std::{fmt::Debug, marker::{Send, Sync}, sync::Arc}; use futures::future::BoxFuture; use log::trace; -use super::Storage; +use crate::dispatching::dialogue::Storage; /// Storage wrapper for logging purposes /// @@ -26,7 +26,7 @@ impl TraceStorage { impl Storage for TraceStorage where D: Debug, - S: Storage, + S: Storage + Send + Sync + 'static, { type Error = >::Error; @@ -49,7 +49,12 @@ where where D: Send + 'static, { - trace!("Updating dialogue with {}: {:#?}", chat_id, dialogue); - >::update_dialogue(self.inner.clone(), chat_id, dialogue) + Box::pin(async move { + trace!("Updating dialogue with {}: {:#?}", chat_id, dialogue); + let from = + >::update_dialogue(self.inner.clone(), chat_id, dialogue).await?; + trace!("Updated dialogue with {}, previous state: {:#?}", chat_id, from); + Ok(from) + }) } }