mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 06:20:20 +00:00
fix: address session-store cache review feedback
This commit is contained in:
committed by
Peter Steinberger
parent
1212328c8d
commit
175c770171
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user