fix: on create skip folder for av scan

This commit is contained in:
MontaGhanmy
2024-11-20 15:17:21 +01:00
parent ea8fc2e2f1
commit f2b85a32b3
@@ -478,7 +478,7 @@ export class DocumentsService {
await updateItemSize(driveItem.parent_id, this.repository, context);
// If AV feature is enabled, scan the file
if (globalResolver.services.av?.avEnabled && version) {
if (!driveItem.is_directory && globalResolver.services.av?.avEnabled && version) {
try {
driveItem.av_status = await globalResolver.services.av.scanDocument(
driveItem,
@@ -530,7 +530,7 @@ export class DocumentsService {
return driveItem;
} catch (error) {
this.logger.error({ error: `${error}` }, "Failed to create drive item");
CrudException.throwMe(error, new CrudException("Failed to create item", 500));
CrudException.throwMe(error, new CrudException(`Failed to create item ${error}`, 500));
}
};