use of com.testsigma.agent.dto.ExecutionDTO in project testsigma by testsigmahq.
the class RunScheduler method run.
@Scheduled(cron = "${agent.jobs.runSchedule:-}")
public void run() {
try {
Thread.currentThread().setName("RunScheduler");
if (skipScheduleRun()) {
log.info("Skipping agent RunScheduler run...");
return;
}
String authHeader = HttpClient.BEARER + " " + agentConfig.getJwtApiKey();
HttpResponse<ExecutionDTO> response = httpClient.get(ServerURLBuilder.executionURL(agentConfig.getUUID()), new TypeReference<>() {
}, authHeader);
if (response.getStatusCode() == HttpStatus.OK.value()) {
ExecutionDTO executionDTO = response.getResponseEntity();
setRequestId(response);
startExecutions(executionDTO.getEnvironment());
} else {
log.error("Unable To Fetch Executions From Testsigma Servers. Request Failed With Response Code - " + response.getStatusCode());
}
} catch (AgentDeletedException e) {
deRegisterAgent(e);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
Aggregations