fix(file cleanup)
This commit is contained in:
@@ -331,7 +331,7 @@ router.post(
|
|||||||
|
|
||||||
// Clean up temp files:
|
// Clean up temp files:
|
||||||
if (result.pdf_path) {
|
if (result.pdf_path) {
|
||||||
await emptyFolderContainingFile(result.pdf_path);
|
await emptyFolderContainingFile(result.ss_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
result.pdfUploadStatus = `PDF saved to group: ${group.title}`;
|
result.pdfUploadStatus = `PDF saved to group: ${group.title}`;
|
||||||
@@ -349,14 +349,14 @@ router.post(
|
|||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
try {
|
try {
|
||||||
if (result && result.pdf_path) {
|
if (result && result.ss_path) {
|
||||||
await emptyFolderContainingFile(result.pdf_path);
|
await emptyFolderContainingFile(result.ss_path);
|
||||||
} else {
|
} else {
|
||||||
console.log(`claim-status-check] no pdf_path available to cleanup`);
|
console.log(`claim-status-check] no pdf_path available to cleanup`);
|
||||||
}
|
}
|
||||||
} catch (cleanupErr) {
|
} catch (cleanupErr) {
|
||||||
console.error(
|
console.error(
|
||||||
`[claim-status-check cleanup failed for ${result?.pdf_path}`,
|
`[claim-status-check cleanup failed for ${result?.ss_path}`,
|
||||||
cleanupErr
|
cleanupErr
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user