fix(api): AgentTask.GetByIp, задание агенту можно выдавать если есть хоть одно поле AgentName || AgentScript
This commit is contained in:
@@ -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
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user