Add some debug output when restarting APISM. APISM is give a delay of 20s when restarting.

This commit is contained in:
Gerhard Hoffmann 2023-08-18 11:52:34 +02:00
parent 978cc16304
commit 337bdd1bb0

View File

@ -506,10 +506,25 @@ bool Worker::updateTriggerSet() {
emit appendText("\n" CHECK_UPDATE_TRIGGER_SET); emit appendText("\n" CHECK_UPDATE_TRIGGER_SET);
QString triggerValue(""); QString triggerValue("");
int const startMs = QTime::currentTime().msecsSinceStartOfDay();
for (int repeat = 0; repeat < 100; ++repeat) { for (int repeat = 1; repeat <= 100; ++repeat) {
qInfo() << "UPDATE TRIGGER SET -> REPEAT" << repeat; qInfo() << "UPDATE TRIGGER SET -> REPEAT" << repeat;
if (repeat > 1) {
int const durationMs = QTime::currentTime().msecsSinceStartOfDay() - startMs;
qInfo() << "REPEAT" << repeat
<< QString("DURATION: %1.%2s").arg(durationMs / 1000).arg(durationMs % 1000);
}
if ((repeat % 10) == 0) {
qInfo() << "CHECK UPDATE TRIGGER. RESTART APISM ...";
Command c("systemctl restart apism");
if (c.execute("/tmp")) {
QThread::sleep(20); // give APISM some time to reconnect
qInfo() << "CHECK UPDATE TRIGGER. RESTARTING APISM DONE";
}
}
startProgressLoop(); startProgressLoop();
if (std::optional<QString> result if (std::optional<QString> result
= IsmasClient::sendRequestReceiveResponse( = IsmasClient::sendRequestReceiveResponse(