fix(storage): a dead flush watch falls back to the 500ms poll, not the 30s sweep
The safety sweep is armed alongside the watch, and startFlushRequestPolling() declines to arm over an existing interval — so when a watch died mid-life the fallback did nothing and the store quietly answered flush requests on a 30s cadence instead of the 500ms one the door promises. The sweep is cleared first. A degrade nobody asked for is still a degrade.
This commit is contained in:
parent
f52053a3d3
commit
ad7f885223
1 changed files with 9 additions and 0 deletions
|
|
@ -2467,6 +2467,15 @@ export class FileSystemStorage extends BaseStorage {
|
|||
)
|
||||
this.flushWatcher?.close()
|
||||
this.flushWatcher = undefined
|
||||
// The SAFETY sweep must go first. It is already armed at 30s, and
|
||||
// startFlushRequestPolling() declines to arm over an existing
|
||||
// interval — so leaving it would quietly leave this store answering
|
||||
// flush requests on a 30s cadence instead of the 500ms one the door
|
||||
// promises. A degrade nobody asked for is still a degrade.
|
||||
if (this.flushWatcherInterval) {
|
||||
clearInterval(this.flushWatcherInterval)
|
||||
this.flushWatcherInterval = undefined
|
||||
}
|
||||
this.startFlushRequestPolling(sweep)
|
||||
})
|
||||
if (typeof watcher.unref === 'function') watcher.unref()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue