init: trigger report update on version change

If the version attribute of init's <config> is changes, trigger the
generation of a new state report that includes the information of the
new version.
This commit is contained in:
Norman Feske 2017-03-16 11:32:28 +01:00 committed by Christian Helmuth
parent a5c70244bf
commit 892043ed76

View File

@ -116,17 +116,24 @@ class Init::State_reporter : public Report_update_trigger
_reporter->enabled(false);
}
_version = config.attribute_value("version", Version());
bool trigger_update = false;
Version const version = config.attribute_value("version", Version());
if (version != _version) {
_version = version;
trigger_update = true;
}
if (_report_delay_ms) {
if (!_timer.constructed()) {
_timer.construct(_env);
_timer->sigh(_timer_handler);
}
trigger_report_update();
trigger_update = true;
}
if (trigger_update)
trigger_report_update();
}
void trigger_report_update() override