diff --git a/FlowerShop/FlowerShopBusinessLogic/BusinessLogics/WorkModeling.cs b/FlowerShop/FlowerShopBusinessLogic/BusinessLogics/WorkModeling.cs index 686187d..51af8c8 100644 --- a/FlowerShop/FlowerShopBusinessLogic/BusinessLogics/WorkModeling.cs +++ b/FlowerShop/FlowerShopBusinessLogic/BusinessLogics/WorkModeling.cs @@ -10,9 +10,7 @@ namespace FlowerShopBusinessLogic.BusinessLogics public class WorkModeling : IWorkProcess { private readonly ILogger _logger; - private readonly Random _rnd; - private IOrderLogic? _orderLogic; public WorkModeling(ILogger Logger) @@ -35,7 +33,6 @@ namespace FlowerShopBusinessLogic.BusinessLogics var Orders = _orderLogic.ReadList(new OrderSearchModel { Status = OrderStatus.Принят }); var BeingProcessedOrders = _orderLogic.ReadList(new OrderSearchModel { Status = OrderStatus.Выполняется }); - // in case there are BeingProcessed orders but no Accepted orders if (Orders == null || BeingProcessedOrders == null || (Orders.Count == 0 && BeingProcessedOrders.Count == 0)) { @@ -68,8 +65,6 @@ namespace FlowerShopBusinessLogic.BusinessLogics { _logger.LogDebug("WorkerWorkAsync. Worker {Id} try get order {Order}", Implementer.Id, Order.Id); - // TakeOrderInWork will fail when the worker tries to change status to BeingProcessed when the order is already BeingProcessed - // which would happen when other worker already acquired that order bool AcquireResult = _orderLogic.TakeOrderInWork(new OrderBindingModel { Id = Order.Id,