From 50d5473404aa7d7ca2a3f99712b20c155b22162a Mon Sep 17 00:00:00 2001 From: Mikhail Kuznetsov Date: Wed, 4 Oct 2023 14:08:52 +1000 Subject: [PATCH] =?UTF-8?q?feat(espptemplatesync):=20=D0=98=D0=B7=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D1=82=D0=B0=D1=82?= =?UTF-8?q?=D1=83=D1=81=D0=B0=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD=D0=B0?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D1=80=D0=BE=D0=B1=D0=BE=D1=82=D0=B0=20?= =?UTF-8?q?=D0=BD=D0=B0=20Wait=20=D0=BF=D1=80=D0=B8=20=D0=BD=D0=B5=D0=BE?= =?UTF-8?q?=D0=B1=D1=85=D0=BE=D0=B4=D0=B8=D0=BC=D0=BE=D1=81=D1=82=D0=B8=20?= =?UTF-8?q?=D0=B5=D0=B3=D0=BE=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=B2=20=D0=90=D0=A1=D0=A3=20=D0=95=D0=A1?= =?UTF-8?q?=D0=9F=D0=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.EsppTemplateSync/Services/Manager.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/PARR.EsppTemplateSync/Services/Manager.cs b/PARR.EsppTemplateSync/Services/Manager.cs index 50f7b6ae..9d7a1c85 100644 --- a/PARR.EsppTemplateSync/Services/Manager.cs +++ b/PARR.EsppTemplateSync/Services/Manager.cs @@ -103,13 +103,13 @@ namespace PARR.EsppTemplateSync.Services else { var mappedTemplate = mapper.Map(template); - if (mappedTemplate == null) + if (mappedTemplate == null) return; var isChanged = IsChanged(mappedTemplate, esppTemplate); if (isChanged) { - SetUpdateStatus(template); + SetUpdateStatus(templateService, template); if (!await templateService.CommitAsync()) { @@ -117,16 +117,17 @@ namespace PARR.EsppTemplateSync.Services } else logger.LogInformation($"----- Установлен принудительный статус обновления Template {template.Name} -----"); - } + } //надо ли проверять если не изменился, но был статус Updating не понятно. Доверяем роботу пока, что после окончания работ от точно сообщит } } return; } - private void SetUpdateStatus(Template template) + private void SetUpdateStatus(ITemplateService templateService, Template template) { template.StatusCode = (int)StatusTemplateEnum.Updating; + templateService.ChangeRobotStatus(RobotStatusEnum.Wait, ref template); } private bool IsChanged(EsppTemplate template, EsppTemplate esppTemplate) @@ -147,7 +148,7 @@ namespace PARR.EsppTemplateSync.Services return true; } - return false; + return false; } } }