Fix build, lint

This commit is contained in:
Daniel Imms
2026-05-02 06:07:41 -07:00
parent e04dd2501f
commit 093e81b9a7
3 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -1199,7 +1199,7 @@ describe('Buffer', () => {
let timeoutId = 0;
let now = 0;
const clearedTimeouts: number[] = [];
const scheduledTimeouts = new Map<number, { delay: number; fire: () => void }>();
const scheduledTimeouts = new Map<number, { delay: number, fire: () => void }>();
(globalThis as any).setTimeout = ((handler: (...args: any[]) => void, timeout?: number) => {
const id = ++timeoutId;
scheduledTimeouts.set(id, {
+5 -6
View File
@@ -5,11 +5,10 @@
import type { IBufferLineStringCache, IBufferLineStringCacheEntry } from 'common/buffer/BufferLine';
import { disposableTimeout } from 'common/Async';
import { Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';
import type { IDisposable } from 'common/Lifecycle';
import { Disposable, MutableDisposable, toDisposable, type IDisposable } from 'common/Lifecycle';
const enum Constants {
CacheTtlMs = 15000
CACHE_TTL_MS = 15000
}
export class BufferLineStringCache extends Disposable implements IBufferLineStringCache {
@@ -54,17 +53,17 @@ export class BufferLineStringCache extends Disposable implements IBufferLineStri
if (this._clearTimeout.value) {
return;
}
this._scheduleClearTimeout(Constants.CacheTtlMs);
this._scheduleClearTimeout(Constants.CACHE_TTL_MS);
}
private _scheduleClearTimeout(timeoutMs: number): void {
this._clearTimeout.value = disposableTimeout(() => {
const elapsed = Date.now() - this._lastAccessTimestamp;
if (elapsed >= Constants.CacheTtlMs) {
if (elapsed >= Constants.CACHE_TTL_MS) {
this.clear();
return;
}
this._scheduleClearTimeout(Constants.CacheTtlMs - elapsed);
this._scheduleClearTimeout(Constants.CACHE_TTL_MS - elapsed);
}, timeoutMs);
}
}