]> git.bitcoin.ninja Git - rapid-gossip-sync-server/commitdiff
Write an `update_time.txt` file out to make monitoring simpler
authorMatt Corallo <git@bluematt.me>
Wed, 15 Mar 2023 17:52:13 +0000 (17:52 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 16 Mar 2023 02:28:00 +0000 (02:28 +0000)
src/snapshot.rs

index dbfbc4deb1871e70b7321f91f01a6ae710457f87..ae28233e448aea058d070126644e550f5d55f389 100644 (file)
@@ -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.");
                        }