#8899 Fixed history_db_enabled 2

This commit is contained in:
Daniel Maya 2022-06-16 08:44:09 +02:00
parent 9a7e0e3228
commit bb01bfe2d0
2 changed files with 10 additions and 14 deletions

View File

@ -1624,44 +1624,40 @@ function config_update_config()
if ($dbm->check() === true) {
// Historical configuration tokens (stored in historical db).
if (Config::set(
if ($dbm->setConfigToken(
'days_purge',
get_parameter('history_dbh_purge'),
true
get_parameter('history_dbh_purge')
) !== true
) {
$error_update[] = __('Historical database purge');
}
if (Config::set(
if ($dbm->setConfigToken(
'history_partitions_auto',
get_parameter_switch('history_partitions_auto', 0),
true
get_parameter_switch('history_partitions_auto', 0)
) !== true
) {
$error_update[] = __('Historical database partitions');
}
if (Config::set(
if ($dbm->setConfigToken(
'event_purge',
get_parameter('history_dbh_events_purge'),
true
get_parameter('history_dbh_events_purge')
) !== true
) {
$error_update[] = __('Historical database events purge');
}
if (Config::set(
if ($dbm->setConfigToken(
'string_purge',
get_parameter('history_dbh_string_purge'),
true
get_parameter('history_dbh_string_purge')
) !== true
) {
$error_update[] = __('Historical database string purge');
}
// Disable history db in history db.
Config::set('history_db_enabled', 0, true);
$dbm->setConfigToken('history_db_enabled', 0);
}
}
break;

View File

@ -384,7 +384,7 @@ final class DBMaintainer
*
* @return boolean Success or not.
*/
private function setConfigToken(string $token, $value)
public function setConfigToken(string $token, $value)
{
$prev = $this->getValue('tconfig', 'value', ['token' => $token]);
// If failed or not found, then insert.