mirror of
https://github.com/alexta69/metube.git
synced 2026-07-18 00:58:18 +00:00
fix: fsync parent dir after direct-write fallback for durability parity
This commit is contained in:
parent
b00d4785ee
commit
54463baf0e
1 changed files with 2 additions and 0 deletions
|
|
@ -169,6 +169,8 @@ class AtomicJsonStore:
|
|||
f.write(text)
|
||||
f.flush()
|
||||
self._best_effort_fsync(f.fileno())
|
||||
# Make the new directory entry durable too, matching the atomic path.
|
||||
self._fsync_directory(os.path.dirname(self.path) or ".")
|
||||
|
||||
@staticmethod
|
||||
def _best_effort_fsync(fileno: int) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue