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; } } }