The fix: I used SQLite BEGIN IMMEDIATE transactions. I made the status check and update a single atomic operation. I used the synchronous nature of better-sqlite3 to make the locking reliable. Lessons ...
This caused duplicate work. The fix: I used SQLite transactions. I made the status check and the update a single atomic operation. I used the synchronous nature of the library to make the locking ...