From: Matt Corallo Date: Wed, 15 Mar 2023 17:52:13 +0000 (+0000) Subject: Write an `update_time.txt` file out to make monitoring simpler X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=8608d533ade21b76c2fa156df24dbccbe878edcb;p=rapid-gossip-sync-server Write an `update_time.txt` file out to make monitoring simpler --- diff --git a/src/snapshot.rs b/src/snapshot.rs index dbfbc4d..ae28233 100644 --- a/src/snapshot.rs +++ b/src/snapshot.rs @@ -116,6 +116,10 @@ impl Snapshotter { symlink(&relative_snapshot_path, &symlink_path).unwrap(); } + let update_time_path = format!("{}/update_time.txt", pending_symlink_directory); + let update_time = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs(); + fs::write(&update_time_path, format!("{}", update_time)).unwrap(); + if fs::metadata(&finalized_snapshot_directory).is_ok(){ fs::remove_dir_all(&finalized_snapshot_directory).expect("Failed to remove finalized snapshot directory."); }