mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-27 20:06:53 -06:00
Merge pull request #1362 from peda-cos/fix/srv9-fsync-files-dir
fix: fsync the files directory after creating a new files folder
This commit is contained in:
@@ -658,7 +658,10 @@ impl Store {
|
||||
let dir = self.dir(&id);
|
||||
let written = fs::create_dir_all(&dir)
|
||||
.map_err(|e| e.to_string())
|
||||
.and_then(|()| disk::write_atomic(&dir.join(SNAPSHOT), &bytes).map_err(|e| e.to_string()))
|
||||
.and_then(|()| {
|
||||
disk::sync_dir(Some(&self.root.join(FILES)));
|
||||
disk::write_atomic(&dir.join(SNAPSHOT), &bytes).map_err(|e| e.to_string())
|
||||
})
|
||||
.and_then(|()| disk::write_atomic(&dir.join(LOG), &disk::log_header(1)).map_err(|e| e.to_string()))
|
||||
.and_then(|()| write_json(&dir.join(LINKS), &[edit.clone(), view.clone()]))
|
||||
// Last: a folder without its description is an upload cut short.
|
||||
|
||||
Reference in New Issue
Block a user