mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
:debug version
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@25726 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
389f05f8d2
commit
dd0161948e
@ -177,8 +177,8 @@
|
||||
# done - this ID must be used for statefile
|
||||
# done - manual statfile creation must use existing ID for version 0
|
||||
# done - table fhemstate no longer needed
|
||||
# configdb reorg must delete old statefiles
|
||||
# remove special handling for large readings
|
||||
# done - configdb reorg must delete old statefiles
|
||||
# done - remove special handling for large readings
|
||||
# check recovery
|
||||
#
|
||||
##############################################################################
|
||||
@ -1069,6 +1069,7 @@ sub _cfgDB_Reorg {
|
||||
_cfgDB_InsertLine($fhem_dbh,$configDB{loaded},"attr configdb lastReorg $ts",-1);
|
||||
$fhem_dbh->commit();
|
||||
$fhem_dbh->disconnect();
|
||||
_cfgDB_deleteStatefiles();
|
||||
eval { qx(sqlite3 $cfgDB_filename vacuum) } if($cfgDB_dbtype eq "SQLITE");
|
||||
return if(defined($quiet));
|
||||
return " Result after database reorg:\n"._cfgDB_Info(undef);
|
||||
@ -1280,6 +1281,22 @@ sub _cfgDB_deleteRF {
|
||||
$fhem_dbh2->disconnect();
|
||||
}
|
||||
|
||||
sub _cfgDB_deleteStatefiles {
|
||||
my $filename;
|
||||
my $fhem_dbh = _cfgDB_Connect;
|
||||
my $sth = $fhem_dbh->prepare( "SELECT filename FROM fhemb64filesave where filename like '%.fhem.save'" );
|
||||
$sth->execute();
|
||||
while ($filename = $sth->fetchrow_array()) {
|
||||
my $uuid = substr($filename,0,32);
|
||||
my $found = $fhem_dbh->selectrow_array("SELECT versionuuid FROM fhemversions WHERE versionuuid = '$uuid'");
|
||||
unless ($uuid eq $found) {
|
||||
$fhem_dbh->do("delete from fhemb64filesave where filename = '$filename'");
|
||||
}
|
||||
}
|
||||
$fhem_dbh->commit();
|
||||
$fhem_dbh->disconnect();
|
||||
}
|
||||
|
||||
##################################################
|
||||
# functions used for file handling
|
||||
# called by 98_configdb.pm
|
||||
|
Loading…
x
Reference in New Issue
Block a user