2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

configDB.pm: log a message if more than 20 versions

git-svn-id: https://svn.fhem.de/fhem/trunk@26295 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2022-08-07 10:27:29 +00:00
parent 88b70cca47
commit e69cb3f47e

View File

@ -855,8 +855,9 @@ sub _cfgDB_Rotate {
$uuid =~ s/^\s+|\s+$//g;
delete $data{saveID}; # no longer needed in memory
$configDB{loaded} = $uuid;
$fhem_dbh->do("UPDATE fhemversions SET VERSION = VERSION+1 where VERSION >= 0") if $newversion == 0;
my $count = $fhem_dbh->do("UPDATE fhemversions SET VERSION = VERSION+1 where VERSION >= 0") if $newversion == 0;
$fhem_dbh->do("INSERT INTO fhemversions values ('$newversion', '$uuid', NULL)");
Log3(undef,1,"configDB: more than 20 versions in database! Please consider setting a limit.") if ($count > 20);
return $uuid;
}