fix: address session-store cache review feedback

This commit is contained in:
Josh Lehman
2026-03-02 13:44:37 -08:00
committed by Peter Steinberger
parent 1212328c8d
commit 175c770171
3 changed files with 26 additions and 26 deletions

View File

@@ -18,17 +18,18 @@ export function isCacheEnabled(ttlMs: number): boolean {
return ttlMs > 0;
}
export function getFileMtimeMs(filePath: string): number | undefined {
try {
return fs.statSync(filePath).mtimeMs;
} catch {
return undefined;
}
}
export type FileStatSnapshot = {
mtimeMs: number;
sizeBytes: number;
};
export function getFileSizeBytes(filePath: string): number | undefined {
export function getFileStatSnapshot(filePath: string): FileStatSnapshot | undefined {
try {
return fs.statSync(filePath).size;
const stats = fs.statSync(filePath);
return {
mtimeMs: stats.mtimeMs,
sizeBytes: stats.size,
};
} catch {
return undefined;
}