mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 09:36:30 +00:00
fix queue, fix ai email and role set
This commit is contained in:
@@ -82,7 +82,7 @@ public class AnnotationService : INotificationHandler<AnnotationsDeletedEvent>
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}, SaveTaskId, TimeSpan.FromSeconds(5), cancellationToken);
|
}, SaveTaskId, TimeSpan.FromSeconds(5), cancellationToken);
|
||||||
|
|
||||||
if (msg.CreatedRole != RoleEnum.Operator) //Process only operator's messages
|
if (msg.CreatedEmail == _authProvider.CurrentUser.Email) //Don't process messages by yourself
|
||||||
return;
|
return;
|
||||||
|
|
||||||
await SaveAnnotationInner(
|
await SaveAnnotationInner(
|
||||||
@@ -106,7 +106,7 @@ public class AnnotationService : INotificationHandler<AnnotationsDeletedEvent>
|
|||||||
{
|
{
|
||||||
a.Time = TimeSpan.FromMilliseconds(a.Milliseconds);
|
a.Time = TimeSpan.FromMilliseconds(a.Milliseconds);
|
||||||
return await SaveAnnotationInner(DateTime.Now, a.OriginalMediaName, a.Time, ".jpg", a.Detections.ToList(),
|
return await SaveAnnotationInner(DateTime.Now, a.OriginalMediaName, a.Time, ".jpg", a.Detections.ToList(),
|
||||||
a.Source, new MemoryStream(a.Image), a.CreatedRole, a.CreatedEmail, generateThumbnail: true, cancellationToken);
|
a.Source, new MemoryStream(a.Image), _authProvider.CurrentUser.Role, _authProvider.CurrentUser.Email, generateThumbnail: true, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Manual
|
//Manual
|
||||||
|
|||||||
@@ -76,8 +76,9 @@ public class FailsafeAnnotationsProducer
|
|||||||
await _annotationConfirmProducer.Send(validatedMessages, CompressionType.Gzip);
|
await _annotationConfirmProducer.Send(validatedMessages, CompressionType.Gzip);
|
||||||
|
|
||||||
await _dbFactory.Run(async db =>
|
await _dbFactory.Run(async db =>
|
||||||
await db.AnnotationsQueue.DeleteAsync(aq => messagesChunk.Any(x => aq.Name == x.OriginalMediaName), token: cancellationToken));
|
await db.AnnotationsQueue.DeleteAsync(aq => messagesChunk.Any(x => aq.Name == x.Name), token: cancellationToken));
|
||||||
sent = true;
|
sent = true;
|
||||||
|
_dbFactory.SaveToDisk();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user