Răsfoiți Sursa

Refactor createAttachment to log completion of attached handlers and ensure temporary file cleanup

Shun Miyazawa 10 luni în urmă
părinte
comite
00df7abbca
1 a modificat fișierele cu 3 adăugiri și 1 ștergeri
  1. 3 1
      apps/app/src/server/service/attachment.js

+ 3 - 1
apps/app/src/server/service/attachment.js

@@ -61,7 +61,9 @@ class AttachmentService {
 
 
       // Do not await, run in background
       // Do not await, run in background
       Promise.all(attachedHandlerPromises)
       Promise.all(attachedHandlerPromises)
-        .finally(disposeTmpFileCallback?.(file));
+        .finally(() => {
+          disposeTmpFileCallback?.(file);
+        });
     }
     }
     catch (err) {
     catch (err) {
       logger.error('Error while creating attachment', err);
       logger.error('Error while creating attachment', err);