-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: call fsync before rename (#1134)
* fix: fsync on the file descriptor used for writing According to the POSIX spec, one needs to call fsync on the file descriptor used for writing, see: https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html Moreover, fail if database.db.tmp exists, since this is an indication something related to database.db writing failed in the past and we did not notice. * fix: Put comment back above fsync * fix: When database.db.tmp already exists, save it * Add a unit test * Prettier does not like CRLF (and I agree) * Make the test work, now that my setup works * Make prettier happy * Update controller.test.ts --------- Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
- Loading branch information
1 parent
ac863e1
commit 1c9190a
Showing
2 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters