From 8608d533ade21b76c2fa156df24dbccbe878edcb Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 15 Mar 2023 17:52:13 +0000 Subject: [PATCH] Write an `update_time.txt` file out to make monitoring simpler --- src/snapshot.rs | 4 ++++ 1 file changed, 4 insertions(+) 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."); } -- 2.39.5