fix datasetexplorer view

save annotation with detections
fix sending to queue
This commit is contained in:
Alex Bezdieniezhnykh
2024-12-26 23:47:03 +02:00
parent 81dcb2a92e
commit 5fe46cd6f5
4 changed files with 24 additions and 15 deletions
+4 -1
View File
@@ -8,6 +8,7 @@ using Azaion.Common.DTO.Queue;
using Azaion.CommonSecurity.DTO;
using Azaion.CommonSecurity.Services;
using LinqToDB;
using LinqToDB.Data;
using MediatR;
using MessagePack;
using Microsoft.Extensions.Options;
@@ -67,7 +68,7 @@ public class AnnotationService
//Queue (only from operators)
public async Task Consume(AnnotationCreatedMessage message, CancellationToken cancellationToken = default)
{
if (message.CreatedRole == RoleEnum.Validator) //Don't proceed our own messages (or from another Validator)
if (message.CreatedRole != RoleEnum.Operator) //Process only operator's messages
return;
await SaveAnnotationInner(
@@ -104,6 +105,8 @@ public class AnnotationService
? AnnotationStatus.Validated
: AnnotationStatus.Created;
await db.Detections.DeleteAsync(x => x.AnnotationName == fName, token: token);
await db.BulkCopyAsync(detections, cancellationToken: token);
if (ann != null)
await db.Annotations
.Where(x => x.Name == fName)