Commit 32eb077c8bcfbd116314f560c200990720227344
1 parent
12905195
Exists in
master
alteração na periodicidade. Me corrija se estiver errado.
Showing
2 changed files
with
4 additions
and
2 deletions
Show diff stats
cacic-daemon/cacicD/cacicd.cpp
| ... | ... | @@ -34,7 +34,8 @@ 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 | - Ocacictimer->setPeriodicidadeExecucao(result["interval"].toInt()); | |
| 37 | + //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); | |
| 38 | 39 | Ocacictimer->iniciarTimer(); |
| 39 | 40 | }else{ |
| 40 | 41 | //TODO: deve iniciar com um timer default (4 horas é um tempo bom), pra não ficar freezado pra sempre. | ... | ... |
cacic-daemon/cacicD/cacictimer.cpp
| ... | ... | @@ -221,7 +221,8 @@ void CacicTimer::verificarPeriodicidadeJson() |
| 221 | 221 | QJsonObject result = ccacic->getJsonFromFile(this->applicationDirPath + "/getConfig.json"); |
| 222 | 222 | if(!result.contains("error") && !result.isEmpty()){ |
| 223 | 223 | if(getPeriodicidadeExecucao() != result["nu_intervalo_exec"].toInt()){ |
| 224 | - setPeriodicidadeExecucao(result["nu_intervalo_exec"].toInt()); //segundo alteração do eduardo, o nome da variável ficou o mesmo de antes. me corrijam se estiver errado | |
| 224 | + //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. | |
| 225 | + setPeriodicidadeExecucao(result["nu_intervalo_exec"].toInt() * 3600); | |
| 225 | 226 | reiniciarTimer(); |
| 226 | 227 | } |
| 227 | 228 | }else{ | ... | ... |