fix(api): AgentTask.GetByIp, задание агенту можно выдавать если есть хоть одно поле AgentName || AgentScript
This commit is contained in:
@@ -92,17 +92,17 @@ namespace PARR.API.Controllers.V1
|
|||||||
continue;
|
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}");
|
$"ApplicationInWorkId: {template.ApplicationInWorkId}, AgentName: {template.ApplicationsInWork.AgentName}, AgentScript: {template.ApplicationsInWork.AgentScript} , ip: {ip}, date: {date}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
templateSchedule.ForEach(item => response.Scheduled.Add(new AgentTaskMinScheduleResponse
|
templateSchedule.ForEach(item => response.Scheduled.Add(new AgentTaskMinScheduleResponse
|
||||||
{
|
{
|
||||||
Name = template.ApplicationsInWork!.AgentName,
|
Name = template.ApplicationsInWork!.AgentName ?? "",
|
||||||
Script = template.ApplicationsInWork!.AgentScript,
|
Script = template.ApplicationsInWork!.AgentScript ?? "",
|
||||||
StartAt = item,
|
StartAt = item,
|
||||||
TemplateId = template.Id
|
TemplateId = template.Id
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user