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

View File

@ -12,6 +12,7 @@ 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)
{ {
@ -66,10 +67,14 @@ namespace FishFactoryBusinessLogic.BusinessLogics
} }
public bool TakeOrderInWork(OrderBindingModel model) public bool TakeOrderInWork(OrderBindingModel model)
{
lock (_locker)
{ {
return StatusUpdate(model, OrderStatus.Выполняется); return StatusUpdate(model, OrderStatus.Выполняется);
} }
}
public bool DeliveryOrder(OrderBindingModel model) public bool DeliveryOrder(OrderBindingModel model)
{ {
return StatusUpdate(model, OrderStatus.Выдан); return StatusUpdate(model, OrderStatus.Выдан);