mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-06 14:02:36 +01:00
fix(server): prove completed history before idle sleep (#18646)
Reviewed and verified at 592bce69c6.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
367f29478d
commit
ccc63ea458
44 files changed
+4100
-112
No files matched your search
@@ -30,8 +30,10 @@ function resolveWithin(baseDir: string, objectKey: string): string {
|
||||
async function statOrNull(filePath: string) {
|
||||
try {
|
||||
return await fs.stat(filePath);
|
||||
} catch {
|
||||
return null;
|
||||
} catch (error) {
|
||||
const code = (error as NodeJS.ErrnoException | null)?.code;
|
||||
if (code === "ENOENT" || code === "ENOTDIR") return null;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,8 +91,9 @@ export function createLocalDiskStorageProvider(baseDir: string): StorageProvider
|
||||
const filePath = resolveWithin(root, input.objectKey);
|
||||
try {
|
||||
await fs.unlink(filePath);
|
||||
} catch {
|
||||
// idempotent delete
|
||||
} catch (error) {
|
||||
const code = (error as NodeJS.ErrnoException | null)?.code;
|
||||
if (code !== "ENOENT" && code !== "ENOTDIR") throw error;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user