You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.
Hi, I think there is a race condition in your project: Since I want to store all objects in a single file, set the type option to single. Then, I have two non-blocking requests r1 and r2. r1 saves object o1 with id 1 and r2 deletes the object by id 1. json-file-store will prepare different this._cache to asynchronously write into file. Since two file writing are asynchronously executed, the content of the file is non-deterministic. In other words, it is non-deterministic whether is object with id 1 exists in the file. Maybe a better solution is to utilize a queue, which sequentializes multiple requests.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, I think there is a race condition in your project: Since I want to store all objects in a single file, set the
type
option tosingle
. Then, I have two non-blocking requestsr1
andr2
.r1
saves objecto1
with id1
andr2
deletes the object by id1
.json-file-store
will prepare differentthis._cache
to asynchronously write into file. Since two file writing are asynchronously executed, the content of the file is non-deterministic. In other words, it is non-deterministic whether is object with id1
exists in the file. Maybe a better solution is to utilize a queue, which sequentializes multiple requests.The text was updated successfully, but these errors were encountered: