2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2024-11-22 09:49:50 +00:00

configDB.pm: improve statefile filename handling

git-svn-id: https://svn.fhem.de/fhem/trunk@25835 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2022-03-14 13:16:20 +00:00
parent 7d3fa00769
commit a97b806895

View File

@ -784,6 +784,7 @@ sub _cfgDB_ReadCfg {
# maybe this will be done with join later
my $uuid = $fhem_dbh->selectrow_array("SELECT versionuuid FROM fhemversions WHERE version = '$version'");
$uuid =~ s/^\s+|\s+$//g;
$configDB{loaded} = $uuid;
Log 4, "configDB read config ".$configDB{loaded};
$sth = $fhem_dbh->prepare( "SELECT * FROM fhemconfig WHERE versionuuid = '$uuid' and device <>'configdb' order by version" );
@ -837,6 +838,7 @@ sub _cfgDB_ReadState {
sub _cfgDB_Rotate {
my ($fhem_dbh,$newversion) = @_;
my $uuid = $data{saveID};
$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;