@samitouri / QOSami-HFS / commits / 7adb5752

close instead of flushing kvstorage-s

Massimo Melina committed Feb 28, 2026 at 16:07 UTC 7adb5752dbe8f0b88eefa09d204e6a2826c5d5bb
3 files changed +3 -3
src/fileAttr.ts
+1 -1
@@ -13,7 +13,7 @@ const fsx = try_(() => {
13 }, () => console.warn('fs-x-attributes not available'))
14
15 const fileAttrDb = new KvStorage({ defaultPutDelay: 1000, maxPutDelay: 5000 })
16 -onProcessExit(() => fileAttrDb.flush())
16 +onProcessExit(() => fileAttrDb.close())
17 const FN = 'file-attr.kv'
18 access(FN).then(() =>
19 fileAttrDb.open(FN).catch(e =>
src/ips.ts
+1 -1
@@ -12,7 +12,7 @@ export const ips = new KvStorage({
12 maxPutDelay: 10 * MINUTE,
13 maxPutDelayCreate: 0,
14 })
15 -onProcessExit(() => ips.flush())
15 +onProcessExit(() => ips.close())
16
17 export const trackIpsMw: Middleware = async (ctx, next) => {
18 if (ips.isOpen() && !isLocalHost(ctx))
src/persistence.ts
+1 -1
@@ -17,4 +17,4 @@ storedMap.open('data.kv').catch(e => {
17 for (const x of await glob('*.kv.lock')) // legacy pre 3.0.5
18 unlink(x).catch(() => {})
19 })
20 -onProcessExit(() => storedMap.flush())
20 +onProcessExit(() => storedMap.close())