This commit is contained in:
Dasha 2024-05-08 22:17:21 +04:00
parent 4f1d7e3010
commit a17f38d3db

View File

@ -12,8 +12,9 @@ namespace FishFactoryBusinessLogic.BusinessLogics
{ {
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly IOrderStorage _orderStorage; private readonly IOrderStorage _orderStorage;
static readonly object _locker = new object();
public OrderLogic(ILogger<OrderLogic> logger, IOrderStorage orderStorage) public OrderLogic(ILogger<OrderLogic> logger, IOrderStorage orderStorage)
{ {
_logger = logger; _logger = logger;
_orderStorage = orderStorage; _orderStorage = orderStorage;
@ -67,7 +68,11 @@ namespace FishFactoryBusinessLogic.BusinessLogics
public bool TakeOrderInWork(OrderBindingModel model) public bool TakeOrderInWork(OrderBindingModel model)
{ {
return StatusUpdate(model, OrderStatus.Выполняется); lock (_locker)
{
return StatusUpdate(model, OrderStatus.Выполняется);
}
} }
public bool DeliveryOrder(OrderBindingModel model) public bool DeliveryOrder(OrderBindingModel model)