👔 Mark the minio reanalysis file as deleted

This commit is contained in:
2026-01-13 01:27:21 +08:00
parent 1fb4b61e51
commit 03010b9151

View File

@@ -4,6 +4,7 @@ using FFMpegCore;
using Microsoft.EntityFrameworkCore;
using Minio;
using Minio.DataModel.Args;
using Minio.Exceptions;
using NetVips;
using DysonNetwork.Shared.Models;
@@ -83,6 +84,12 @@ public class FileReanalysisService(
logger.LogInformation("File {FileId} already up to date", file.Id);
}
}
catch (ObjectNotFoundException)
{
logger.LogWarning("File {FileId} not found in remote storage, deleting record", file.Id);
db.Files.Remove(file);
await db.SaveChangesAsync();
}
catch (Exception ex)
{
logger.LogError(ex, "Failed to reanalyze file {FileId}", file.Id);