fix: (regression 3.0.4) removed faulty lock system for kv files, mostly affecting docker users #1174
Massimo Melina committed
Feb 28, 2026 at 12:22 UTC
a44c59b01032a1677337b212aff1af88ba1bdef4
3 files changed
+8
-4
e2e/frontend.spec.ts
+1
-1
@@ -431,7 +431,7 @@ test('anew', async ({ page, browserName }) => {
431
await addBtn.click()
432
await adminPage.getByRole('menuitem', { name: 'from disk' }).click()
433
await adminPage.getByRole('textbox', { name: /Filter results/ }).fill('data')
434
- await expect(adminPage.getByText('Filter results (2/')).toBeVisible()
434
+ await expect(adminPage.getByText('Filter results (1/')).toBeVisible()
435
await adminPage.getByRole('checkbox').first().check()
436
await adminPage.getByText('data.kv').first().click()
437
await addBtn.click()
package.json
+1
-1
@@ -79,7 +79,7 @@
79
},
80
"dependencies": {
81
"@gregoranders/csv": "^0.0.13",
82
- "@rejetto/kvstorage": "^0.15.4",
82
+ "@rejetto/kvstorage": "^0.16.0",
83
"acme-client": "^5.4.0",
84
"busboy": "^1.6.0",
85
"crc-32": "^1.2.2",
src/persistence.ts
+6
-2
@@ -1,6 +1,8 @@
1
import { KvStorage } from '@rejetto/kvstorage'
2
import { MINUTE } from './misc'
3
import { onProcessExit } from './first'
4
+import glob from 'fast-glob'
5
+import { unlink } from 'fs/promises'
6
7
export const storedMap = new KvStorage({
8
defaultPutDelay: 5000,
@@ -10,7 +12,9 @@ export const storedMap = new KvStorage({
12
bucketThreshold: 10_000,
13
})
14
storedMap.open('data.kv').catch(e => {
13
- console.error(e?.message.includes('locked') ? `Check if another HFS is running on the same config folder – ${e.message}` : String(e))
14
- process.exit(3)
15
+ console.error("Persistence won't work correctly", e)
16
+}).finally(async () => {
17
+ for (const x of await glob('*.kv.lock')) // legacy pre 3.0.5
18
+ unlink(x).catch(() => {})
19
})
20
onProcessExit(() => storedMap.flush())