mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-07 19:04:20 +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:
parent
7d3fa00769
commit
a97b806895
@ -784,6 +784,7 @@ sub _cfgDB_ReadCfg {
|
|||||||
|
|
||||||
# maybe this will be done with join later
|
# maybe this will be done with join later
|
||||||
my $uuid = $fhem_dbh->selectrow_array("SELECT versionuuid FROM fhemversions WHERE version = '$version'");
|
my $uuid = $fhem_dbh->selectrow_array("SELECT versionuuid FROM fhemversions WHERE version = '$version'");
|
||||||
|
$uuid =~ s/^\s+|\s+$//g;
|
||||||
$configDB{loaded} = $uuid;
|
$configDB{loaded} = $uuid;
|
||||||
Log 4, "configDB read config ".$configDB{loaded};
|
Log 4, "configDB read config ".$configDB{loaded};
|
||||||
$sth = $fhem_dbh->prepare( "SELECT * FROM fhemconfig WHERE versionuuid = '$uuid' and device <>'configdb' order by version" );
|
$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 {
|
sub _cfgDB_Rotate {
|
||||||
my ($fhem_dbh,$newversion) = @_;
|
my ($fhem_dbh,$newversion) = @_;
|
||||||
my $uuid = $data{saveID};
|
my $uuid = $data{saveID};
|
||||||
|
$uuid = =~ s/^\s+|\s+$//g;
|
||||||
delete $data{saveID}; # no longer needed in memory
|
delete $data{saveID}; # no longer needed in memory
|
||||||
$configDB{loaded} = $uuid;
|
$configDB{loaded} = $uuid;
|
||||||
$fhem_dbh->do("UPDATE fhemversions SET VERSION = VERSION+1 where VERSION >= 0") if $newversion == 0;
|
$fhem_dbh->do("UPDATE fhemversions SET VERSION = VERSION+1 where VERSION >= 0") if $newversion == 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user