2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-08 13:24:56 +00:00

93_DbRep: contrib v 8.47.0

git-svn-id: https://svn.fhem.de/fhem/trunk@25475 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2022-01-16 16:45:33 +00:00
parent 5a98030112
commit 8564b44f73

View File

@ -11421,19 +11421,29 @@ sub DbRep_initSQLcmdCache {
my $name = shift;
my $hash = $defs{$name};
RemoveInternalTimer ($name, "DbRep_initSQLcmdCache");
if (!$init_done) {
InternalTimer(time+1, "DbRep_initSQLcmdCache", $name, 0);
return;
}
$data{DbRep}{$name}{sqlcache}{index} = 0; # SQL-CommandHistory CacheIndex
my ($err,$hl) = DbRep_getCmdFile($name."_sqlCmdList");
if($hl) {
$hl = (split ":", $hl, 2)[1];
Log3 ($name, 4, "DbRep $name - history sql commandlist read from file ".$attr{global}{modpath}."/FHEM/FhemUtils/cacheDbRep");
my @cmds = split ",", $hl;
my @cmds = split ",", $hl;
my $count = 0;
for my $elem (@cmds) {
$elem = _DbRep_deconvertSQL ($elem);
_DbRep_insertSQLtoCache ($name, $elem);
$count++;
}
Log3 ($name, 4, qq{DbRep $name - SQL history restored from Cache file - count: "$count"}) if($count);
}
return;