mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 08:03:39 +00:00
* perf: bound repeated watcher, vault, and terminal work * fix(terminal): preserve redraw recovery while bounding fit retries * fix(watcher): retain structural fallback after crash fuse * fix(ai-vault): preserve forced scan budget
18 lines
415 B
TypeScript
18 lines
415 B
TypeScript
const WATCHER_FAILURE_REFRESH_COOLDOWN_MS = 60_000
|
|
|
|
export class WorktreeWatcherFailureRefreshCooldown {
|
|
private refreshedAt: number | null = null
|
|
|
|
consume(now = Date.now()): boolean {
|
|
if (this.refreshedAt !== null && now - this.refreshedAt < WATCHER_FAILURE_REFRESH_COOLDOWN_MS) {
|
|
return false
|
|
}
|
|
this.refreshedAt = now
|
|
return true
|
|
}
|
|
|
|
reset(): void {
|
|
this.refreshedAt = null
|
|
}
|
|
}
|