Commit d569f3d0cce5aafca54f959829036064761cd662

Authored by Thiago Rocha
1 parent 495bc8ee
Exists in master

Método start() do cacicd.cpp alterado para adaptar ao json de getConfig().

Showing 1 changed file with 5 additions and 1 deletions   Show diff stats
cacic-daemon/cacicD/cacicd.cpp
... ... @@ -34,8 +34,12 @@ void cacicD::start() {
34 34 QLogger::QLog_Info("Cacic Daemon", QString("Servico iniciado em " + application()->applicationDirPath() + "."));
35 35 QJsonObject result = ccacic->getJsonFromFile(application()->applicationDirPath() + "/getConfig.json");
36 36 if(!result.contains("error") && !result.isEmpty()){
  37 +
  38 + QJsonObject agenteConfigJson = result["agentcomputer"].toObject();
  39 + QJsonObject configuracoes = agenteConfigJson["configuracoes"].toObject();
  40 +
37 41 //o valor nu_intervalo_exec vem em horas. Se não me engano, o valor que o timer aceita é em segundos,por isso 3600
38   - Ocacictimer->setPeriodicidadeExecucao(result["reply"].toObject()["nu_intervalo_exec"].toInt() * 3600);
  42 + Ocacictimer->setPeriodicidadeExecucao(configuracoes["nu_intervalo_exec"].toInt() * 3600);
39 43 Ocacictimer->iniciarTimer();
40 44 }else{
41 45 //Iniciar com um timer default (4 horas), pra não ficar freezado pra sempre.
... ...