Commit 495bc8ee570842d716fe7fb74220b1a15487f96d
1 parent
d538265d
Exists in
master
Método verificarPeridiocidadeJson alterado para adaptar ao json de getConfig().
Showing
1 changed file
with
5 additions
and
4 deletions
Show diff stats
cacic-daemon/cacicD/cacictimer.cpp
... | ... | @@ -228,12 +228,13 @@ void CacicTimer::iniciarInstancias(){ |
228 | 228 | |
229 | 229 | void CacicTimer::verificarPeriodicidadeJson() |
230 | 230 | { |
231 | - //adaptar ao getConfig. | |
232 | 231 | QJsonObject result = ccacic->getJsonFromFile(this->applicationDirPath + "/getConfig.json"); |
233 | 232 | if(!result.contains("error") && !result.isEmpty()){ |
234 | - if(getPeriodicidadeExecucao() != result["nu_intervalo_exec"].toInt()){ | |
235 | - //segundo alteração do eduardo, o nome da variável ficou o mesmo de antes. me corrijam se estiver errado. 3600 por ser tratado em horas. | |
236 | - setPeriodicidadeExecucao(result["nu_intervalo_exec"].toInt() * 3600); | |
233 | + | |
234 | + QJsonObject agenteConfigJson = result["agentcomputer"].toObject(); | |
235 | + QJsonObject configuracoes = agenteConfigJson["configuracoes"].toObject(); | |
236 | + if(getPeriodicidadeExecucao() != configuracoes["nu_intervalo_exec"].toInt()){ | |
237 | + setPeriodicidadeExecucao(configuracoes["nu_intervalo_exec"].toInt() * 3600); | |
237 | 238 | reiniciarTimer(); |
238 | 239 | } |
239 | 240 | }else{ | ... | ... |