Skip to content

Commit

Permalink
fix(updates): Ignore reload on update when file is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Shirokov committed Mar 10, 2020
1 parent 3a97088 commit 5e7f7f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export const open = async <T>(
};

fs.watch(filepath, watcherOptions, async () => {
// When database file is being replaced,
// it could be removed for a fraction of a second.
if (!fs.existsSync(filepath)) {
return;
}
Expand Down

0 comments on commit 5e7f7f9

Please sign in to comment.