From 00e034edf5e49b45d5e06b40fe4e563f25f57326 Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Tue, 28 Nov 2023 12:16:12 +1000 Subject: [PATCH] =?UTF-8?q?fix(api):=20AgentTask.GetByIp,=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B0=D0=B3=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D1=83=20=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=20=D0=B2=D1=8B=D0=B4?= =?UTF-8?q?=D0=B0=D0=B2=D0=B0=D1=82=D1=8C=20=D0=B5=D1=81=D0=BB=D0=B8=20?= =?UTF-8?q?=D0=B5=D1=81=D1=82=D1=8C=20=D1=85=D0=BE=D1=82=D1=8C=20=D0=BE?= =?UTF-8?q?=D0=B4=D0=BD=D0=BE=20=D0=BF=D0=BE=D0=BB=D0=B5=20AgentName=20||?= =?UTF-8?q?=20AgentScript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.API/Controllers/V1/AgentTaskController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PARR.API/Controllers/V1/AgentTaskController.cs b/PARR.API/Controllers/V1/AgentTaskController.cs index 5cdac32f..885a69e4 100644 --- a/PARR.API/Controllers/V1/AgentTaskController.cs +++ b/PARR.API/Controllers/V1/AgentTaskController.cs @@ -92,17 +92,17 @@ namespace PARR.API.Controllers.V1 continue; } - if (string.IsNullOrEmpty(template.ApplicationsInWork.AgentName) || string.IsNullOrEmpty(template.ApplicationsInWork.AgentScript)) + if (string.IsNullOrEmpty(template.ApplicationsInWork.AgentName) && string.IsNullOrEmpty(template.ApplicationsInWork.AgentScript)) { - logger.LogWarning($"Запросили задание для агента с пустыми значениями AgentName || AgentScript. Такого не должно быть! " + + logger.LogWarning($"Запросили задание для агента с пустыми значениями AgentName && AgentScript. Такого не должно быть! " + $"ApplicationInWorkId: {template.ApplicationInWorkId}, AgentName: {template.ApplicationsInWork.AgentName}, AgentScript: {template.ApplicationsInWork.AgentScript} , ip: {ip}, date: {date}"); continue; } templateSchedule.ForEach(item => response.Scheduled.Add(new AgentTaskMinScheduleResponse { - Name = template.ApplicationsInWork!.AgentName, - Script = template.ApplicationsInWork!.AgentScript, + Name = template.ApplicationsInWork!.AgentName ?? "", + Script = template.ApplicationsInWork!.AgentScript ?? "", StartAt = item, TemplateId = template.Id }));