2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

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

git-svn-id: https://svn.fhem.de/fhem/trunk@26297 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2022-08-07 13:19:35 +00:00
parent 95625a722f
commit d27d9f2e15

View File

@ -859,7 +859,8 @@ sub _cfgDB_Rotate {
$configDB{loaded} = $uuid;
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);
Log3(undef,1,"configDB: more than 20 versions in database! Please consider setting a limit.")
if ($count > 20 && !defined($configDB{attr}{maxversions}));
return $uuid;
}