diff --git a/fs-storage/src/file_storage.rs b/fs-storage/src/file_storage.rs index 276c808c..32daf013 100644 --- a/fs-storage/src/file_storage.rs +++ b/fs-storage/src/file_storage.rs @@ -254,6 +254,8 @@ where let mut file = File::create(&self.path)?; file.write_all(serde_json::to_string_pretty(&self.data)?.as_bytes())?; file.flush()?; + // Drop the file handle to ensure metadata is updated + drop(file); let new_timestamp = fs::metadata(&self.path)?.modified()?; if new_timestamp == self.modified {