chore: generate

This commit is contained in:
opencode-agent[bot]
2026-06-07 05:25:52 +00:00
parent 106f8e94d6
commit 21a644fef5
12 changed files with 40 additions and 50 deletions
+2 -4
View File
@@ -19,7 +19,7 @@ export const { use: useKV, provider: KVProvider } = createSimpleContext({
// Queue same-process writes so rapid updates persist in order.
let write = Promise.resolve()
;Flock.withLock(lock, () => readJson<Record<string, unknown>>(file))
Flock.withLock(lock, () => readJson<Record<string, unknown>>(file))
.then((x) => {
setStore(x)
})
@@ -55,9 +55,7 @@ export const { use: useKV, provider: KVProvider } = createSimpleContext({
setStore(key, value)
const snapshot = structuredClone(unwrap(store))
write = write
.then(() =>
Flock.withLock(lock, () => writeJsonAtomic(file, snapshot)),
)
.then(() => Flock.withLock(lock, () => writeJsonAtomic(file, snapshot)))
.catch((error) => {
console.error("Failed to write KV state", { error })
})