Implement Max Queue and Max Batch size when publishing

MaxPublishBatchSize must be set, but MaxQueueSize can be set to 0 to disable check of the rabbitmq queue size
This commit is contained in:
iPromKnight
2024-02-02 14:43:29 +00:00
parent 8ad6cf731c
commit 57f4757541
7 changed files with 83 additions and 13 deletions

View File

@@ -17,7 +17,13 @@ public class PublisherJob(IMessagePublisher publisher, IDataStorage storage, ILo
return;
}
await publisher.PublishAsync(torrents, cancellationToken);
var published = await publisher.PublishAsync(torrents, cancellationToken);
if (!published)
{
return;
}
var result = await storage.SetTorrentsProcessed(torrents, cancellationToken);
if (!result.Success)