mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2026-01-17 21:14:22 +01:00
Some more logs
This commit is contained in:
@@ -66,7 +66,7 @@ impl Persister {
|
||||
}
|
||||
let mut sync_trigger = None;
|
||||
if sync_enabled {
|
||||
let (events_notifier, _) = broadcast::channel::<()>(100);
|
||||
let (events_notifier, _) = broadcast::channel::<()>(1);
|
||||
sync_trigger = Some(events_notifier);
|
||||
}
|
||||
Ok(Persister {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use anyhow::Result;
|
||||
use log::info;
|
||||
use rusqlite::{
|
||||
named_params, Connection, OptionalExtension, Row, Statement, Transaction, TransactionBehavior,
|
||||
};
|
||||
@@ -499,6 +500,7 @@ impl Persister {
|
||||
}
|
||||
|
||||
pub(crate) fn trigger_sync(&self) {
|
||||
info!("realtime-sync: Triggering sync");
|
||||
if let Some(sender) = self.sync_trigger.clone() {
|
||||
_ = sender.send(());
|
||||
}
|
||||
|
||||
@@ -110,11 +110,12 @@ impl SyncService {
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
log::info!("realtime-sync: Starting sync service loop");
|
||||
loop {
|
||||
log::info!("realtime-sync: before tokio_select");
|
||||
tokio::select! {
|
||||
local_event = local_sync_trigger.recv() => {
|
||||
log::info!("realtime-sync: Received local message");
|
||||
match local_event {
|
||||
Ok(_) => self.run_event_loop().await,
|
||||
Err(err) => {
|
||||
@@ -122,12 +123,15 @@ impl SyncService {
|
||||
}
|
||||
}
|
||||
}
|
||||
Some(msg) = remote_sync_trigger.next() => match msg {
|
||||
Some(msg) = remote_sync_trigger.next() => {
|
||||
log::info!("realtime-sync: Received remote message");
|
||||
match msg {
|
||||
Ok(_) => self.run_event_loop().await,
|
||||
Err(err) => {
|
||||
log::warn!("realtime-sync: Received status {} from remote, attempting to reconnect.", err.message());
|
||||
break; // break the inner loop which will start the main loop by reconnecting
|
||||
}
|
||||
}
|
||||
},
|
||||
_ = shutdown.changed() => {
|
||||
log::info!("realtime-sync: Received shutdown signal, exiting realtime sync service loop");
|
||||
|
||||
Reference in New Issue
Block a user