Closed appy-one closed 1 year ago
I'm parking this PR because I implemented an automatically starting up IPC service/"daemon" in #213, which acts as an automatic (local) IPC master for each process requesting access to the same database. Locking the file will therefore not be necessary.
(H)appy new year! 🍾🥂
This PR helps preventing database corruption #48 by disallowing multiple processes to access the same database file simultaneously, unless they are using IPC for inter-process communication. This means that forked processes with pm2 or NodeJS clustering, or servers using acebase-ipc-server can still all access the database simultaneously, but all other processes that try to open an already open db will be denied access.
For its implementation I have modified proper-lockfile instead of adding it as a dependency for the following reasons:
I changed the following:
signal-exit
dependency (not needed)retry
dependency (using own simple implementation)graceful-fs
dependency (using own pfs)requires
acebase-core #29
to be merged, dependency updated