Skip to content

Commit

Permalink
Merge pull request #33 from Duddino/sync-keep
Browse files Browse the repository at this point in the history
Keep syncing after initial sync
  • Loading branch information
Duddino authored Jan 28, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents dc50d49 + 7eea569 commit 49e2952
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src-tauri/src/explorer/mod.rs
Original file line number Diff line number Diff line change
@@ -4,7 +4,9 @@ use jsonrpsee::rpc_params;
use serde::Deserialize;
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;
use tokio::sync::{OnceCell, RwLock};
use tokio::time::sleep;

use crate::address_index::{
database::Database, pivx_rpc::PIVXRpc, sql_lite::SqlLite, types::Vin, AddressIndex,
@@ -222,7 +224,10 @@ where
.await?;
self.switch_to_rpc_source().await?;
*self.done_indexing.write().await = true;
Ok(())
loop {
sleep(Duration::from_secs(60)).await;
self.address_index.write().await.sync().await?;
}
}

pub async fn switch_to_rpc_source(&self) -> crate::error::Result<()> {

0 comments on commit 49e2952

Please sign in to comment.