From 06a96b814893bba14c7d82cb9c2d03c33c89c494 Mon Sep 17 00:00:00 2001 From: Domenico De Guglielmo Date: Sat, 28 Oct 2023 19:19:17 +0200 Subject: [PATCH] fix --- dht-cache/src/domocache.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dht-cache/src/domocache.rs b/dht-cache/src/domocache.rs index f44f459..027bd75 100644 --- a/dht-cache/src/domocache.rs +++ b/dht-cache/src/domocache.rs @@ -341,7 +341,12 @@ impl DomoCache { log::info!("Caches are not synchronized"); if leader { log::info!("Publishing my cache since I am the leader for the hash"); + if self.last_cache_repub_timestamp + < (utils::get_epoch_ms() - 1000 * u128::from(SEND_CACHE_HASH_PERIOD)) + { self.publish_cache().await; + } + } else { log::info!("I am not the leader for the hash"); }