Files
agency/.pnpm-store/v3/files/af/a448f26fa7c0a72bba7e1e280f73ec385388c190f5294276750a7d500a46e785074b4ab22ff9eba1011031846dfe8004f63f221e6d288b7e9c0da0f8ef4310
hanzo-agent 5af6960b87 run project
Run: sess_f37640604ae254cb4d11dc6217f7b721
2026-09-30 00:04:56 +00:00

33 lines
770 B
Plaintext

// src/removable.ts
import { timeoutManager } from "./timeoutManager.js";
import { isServer, isValidTimeout } from "./utils.js";
var Removable = class {
#gcTimeout;
destroy() {
this.clearGcTimeout();
}
scheduleGc() {
this.clearGcTimeout();
if (isValidTimeout(this.gcTime)) {
this.#gcTimeout = timeoutManager.setTimeout(() => {
this.optionalRemove();
}, this.gcTime);
}
}
updateGcTime(newGcTime) {
this.gcTime = Math.max(
this.gcTime || 0,
newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3)
);
}
clearGcTimeout() {
if (this.#gcTimeout) {
timeoutManager.clearTimeout(this.#gcTimeout);
this.#gcTimeout = void 0;
}
}
};
export {
Removable
};
//# sourceMappingURL=removable.js.map