Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file seems to be locked when setting the data after getting the data #89

Closed
jgarza9788 opened this issue Oct 8, 2017 · 4 comments
Closed

Comments

@jgarza9788
Copy link

2017-10-08_12-59-30

@jviotti
Copy link
Member

jviotti commented Oct 10, 2017

Is there any chance you can provide a stack trace? ie by printing the error object from the main process?

@jgarza9788
Copy link
Author

jgarza9788 commented Oct 10, 2017 via email

@jviotti
Copy link
Member

jviotti commented Oct 11, 2017

@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?

jviotti added a commit that referenced this issue Jul 10, 2018
Fixes: #107
Fixes: #89
Fixes: #40
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
jviotti added a commit that referenced this issue Jul 10, 2018
Fixes: #107
Fixes: #89
Fixes: #40
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti
Copy link
Member

jviotti commented Jul 10, 2018

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!

jviotti added a commit that referenced this issue Jul 10, 2018
Fixes: #107
Fixes: #89
Fixes: #40
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
jviotti added a commit that referenced this issue Jul 10, 2018
Fixes: #107
Fixes: #89
Fixes: #40
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants