electron-userland / electron-json-storage

:package: Easily write and read user settings in Electron apps
1.43k stars 79 forks source link

getall #88

Open jgarza9788 opened 6 years ago

jgarza9788 commented 6 years ago

get all is not releasing the file lock after it's used

jviotti commented 6 years ago

Can you better explain what you observed? .getAll() doesn't use any lock mechanism (see https://github.com/electron-userland/electron-json-storage/blob/master/lib/storage.js#L210). The only function that performs locking is .set() (see https://github.com/electron-userland/electron-json-storage/blob/master/lib/storage.js#L272), but the lock is released after fs.writeFile completes, even if an error happened.