chore: make GC_CHECKPOINT_THRESHOLD configurable

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
Gaurav Saini 2025-05-18 12:47:58 +10:00 committed by GitHub
parent 43387b1e2a
commit 4de36f913a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,7 +31,7 @@ export abstract class ShadowCheckpointService extends EventEmitter {
// --- CHANGE START: Add cache for nested git repo paths ---
// --- ADDITION: GC related properties ---
private gcCounter: number = 0
private readonly GC_CHECKPOINT_THRESHOLD: number = 20 // Run gc every 20 checkpoints
private readonly GC_CHECKPOINT_THRESHOLD: number = Number(process.env.GC_CHECKPOINT_THRESHOLD) || 20 // Run gc every 20 checkpoints
private _nestedGitDirPaths: string[] | null = null // Cache for relative paths like "submodule/.git"
// --- CHANGE END: Add cache for nested git repo paths ---
protected shadowGitConfigWorktree?: string