Optimize reanalysis query

This commit is contained in:
2026-01-14 01:37:40 +08:00
parent 988d9695b3
commit db5dcf19b2
2 changed files with 2 additions and 2 deletions

View File

@@ -28,7 +28,8 @@ public class FileReanalysisService(
.Where(f => f.ObjectId != null)
.Include(f => f.Object)
.ThenInclude(f => f.FileReplicas)
.Where(f => f.Object!.Meta == null || f.Object.Meta.Count == 0 || f.Object.Size == 0 || f.Object.Hash == null)
.Where(f => ((f.Object!.MimeType == null || !f.Object.MimeType.StartsWith("application/")) &&
(f.Object!.Meta == null || f.Object.Meta.Count == 0)) || f.Object.Size == 0 || f.Object.Hash == null)
.Where(f => f.Object!.FileReplicas.Count > 0)
.Where(f => f.CreatedAt <= deadline)
.OrderBy(f => f.Object!.UpdatedAt)