Skip to content

Commit

Permalink
reset timer
Browse files Browse the repository at this point in the history
  • Loading branch information
mojoX911 committed Jan 9, 2025
1 parent 8260f92 commit 09b76d3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/market/directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,13 @@ impl DirectoryServer {
write_lock.remove(&existing_key);
write_lock.insert(metadata.1, (metadata.0, Instant::now()));
} else {
log::info!("Maker data already exist for {}", metadata.0);
log::info!(
"Maker data already exist for {} | restarted counter",
metadata.0
);
write_lock
.entry(metadata.1)
.and_modify(|(_, instant)| *instant = Instant::now());
}
} else if write_lock.contains_key(&metadata.1) {
// Update the address for the existing fidelity
Expand Down Expand Up @@ -307,7 +313,6 @@ pub(crate) fn start_address_writer_thread(
) -> Result<(), DirectoryServerError> {
let interval = 60 * 15;
loop {
sleep(Duration::from_secs(interval));
let mut directory_address_book = directory.addresses.write()?;
let ttl = Duration::from_secs(60 * 30);

Expand All @@ -324,6 +329,7 @@ pub(crate) fn start_address_writer_thread(
directory_address_book.remove(outpoint);
log::info!("Maker entry removed");
}
sleep(Duration::from_secs(interval));
}
}

Expand Down

0 comments on commit 09b76d3

Please sign in to comment.