From f1233bdbccc8227611b94f35d663991bb56cc9ea Mon Sep 17 00:00:00 2001 From: devil_1nc Date: Mon, 24 Jul 2023 17:06:49 +0400 Subject: [PATCH] wm fix --- .../BusinessLogic/WorkModeling.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/WorkModeling.cs b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/WorkModeling.cs index 3ba8066..d8480ef 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/WorkModeling.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/WorkModeling.cs @@ -71,17 +71,15 @@ namespace AbstractSoftwareInstallationBusinessLogic.BusinessLogic })) { // делаем работу - Thread.Sleep(implementer.WorkExperience * _rnd.Next(1000, 10000) * order.Count); + Thread.Sleep(implementer.WorkExperience * _rnd.Next(100, 1000) * order.Count); _logger.LogDebug("DoWork. Worker {Id} finish order {Order}", implementer.Id, order.Id); _orderLogic.FinishOrder(new OrderBindingModel { Id = order.Id, ImplementerId = implementer.Id }); - // отдыхаем - Thread.Sleep(implementer.Qualification * _rnd.Next(10, 100)); - } + } } // кто-то мог уже перехватить заказ, игнорируем ошибку catch (InvalidOperationException ex) @@ -94,6 +92,8 @@ namespace AbstractSoftwareInstallationBusinessLogic.BusinessLogic _logger.LogError(ex, "Error while do work"); throw; } + // отдыхаем + Thread.Sleep(implementer.Qualification * _rnd.Next(10, 100)); } }); } @@ -138,7 +138,5 @@ namespace AbstractSoftwareInstallationBusinessLogic.BusinessLogic throw; } } - - } }