#8899 Fixed history_db_enabled

This commit is contained in:
Daniel Maya 2022-06-15 09:37:29 +02:00
parent 9fd4e415c0
commit 9a7e0e3228
1 changed files with 43 additions and 40 deletions

View File

@ -1619,48 +1619,51 @@ function config_update_config()
$dbm->process();
} else if ($dbm->check() !== true) {
$errors[] = $dbm->getLastError();
config_update_value('history_db_enabled', false);
}
if ($dbm->check() === true) {
// Historical configuration tokens (stored in historical db).
if (Config::set(
'days_purge',
get_parameter('history_dbh_purge'),
true
) !== true
) {
$error_update[] = __('Historical database purge');
}
if (Config::set(
'history_partitions_auto',
get_parameter_switch('history_partitions_auto', 0),
true
) !== true
) {
$error_update[] = __('Historical database partitions');
}
if (Config::set(
'event_purge',
get_parameter('history_dbh_events_purge'),
true
) !== true
) {
$error_update[] = __('Historical database events purge');
}
if (Config::set(
'string_purge',
get_parameter('history_dbh_string_purge'),
true
) !== true
) {
$error_update[] = __('Historical database string purge');
}
// Disable history db in history db.
Config::set('history_db_enabled', 0, true);
}
}
// Historical configuration tokens (stored in historical db).
if (Config::set(
'days_purge',
get_parameter('history_dbh_purge'),
true
) !== true
) {
$error_update[] = __('Historical database purge');
}
if (Config::set(
'history_partitions_auto',
get_parameter_switch('history_partitions_auto', 0),
true
) !== true
) {
$error_update[] = __('Historical database partitions');
}
if (Config::set(
'event_purge',
get_parameter('history_dbh_events_purge'),
true
) !== true
) {
$error_update[] = __('Historical database events purge');
}
if (Config::set(
'string_purge',
get_parameter('history_dbh_string_purge'),
true
) !== true
) {
$error_update[] = __('Historical database string purge');
}
// Disable history db in history db.
Config::set('history_db_enabled', 0, true);
break;
case 'ehorus':