diff --git a/src/maker/data.rs b/src/maker/data.rs index 15fdd1a..40ed5cd 100644 --- a/src/maker/data.rs +++ b/src/maker/data.rs @@ -85,13 +85,14 @@ impl MakerActorData { let store = Arc::new(RwLock::new(store)); let (persist_tx, task_handle) = Self::setup_persistance(store.clone(), trade_uuid, &dir_path); - - Self { + let data = Self { persist_tx, trade_uuid, store, task_handle, - } + }; + data.queue_persistance(); + data } pub(crate) async fn restore(data_path: impl AsRef) -> Result<(Uuid, Self), N3xbError> { diff --git a/src/taker/data.rs b/src/taker/data.rs index 4b2eb75..9e00787 100644 --- a/src/taker/data.rs +++ b/src/taker/data.rs @@ -70,13 +70,14 @@ impl TakerActorData { let store = Arc::new(RwLock::new(store)); let (persist_tx, task_handle) = Self::setup_persistance(store.clone(), trade_uuid, &dir_path); - - Self { + let data = Self { persist_tx, trade_uuid, store, task_handle, - } + }; + data.queue_persistance(); + data } pub(crate) async fn restore(data_path: impl AsRef) -> Result<(Uuid, Self), N3xbError> {