file seems to be locked when setting the data after getting the data
jgarza9788 opened this issue · 4 comments
Is there any chance you can provide a stack trace? ie by printing the error object from the main process?
@jgarza9788 Saving too often shouldn't be an issue. The test cases perform stress testing on the module, by very quickly writing a thousand entries, even in parallel (https://github.com/electron-userland/electron-json-storage/blob/master/tests/storage.spec.js#L51). Are you sure there is not something else going on with your app?
Hi @jgarza9788. Good news! I believe I fixed this issue on this PR: #110. Would you mind giving a shot to confirm the issue is ruled out before merging and publishing?
Basically the problem was that the locking module I was using was not doing real locking, but just some checks in-memory within the same process, so writing the file from more than one process would trigger the issue.
Let me know!