2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-16 04:36:02 +00:00

92_FileLog.pm: make addLog rereadcfg safe (Forum #118054)

git-svn-id: https://svn.fhem.de/fhem/trunk@23636 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2021-01-29 20:03:57 +00:00
parent 3c32b515a4
commit 9f9fd8221c

View File

@ -73,12 +73,6 @@ FileLog_Initialize($)
InternalTimer(time()+0.1, sub() { # Forum #39792
map { HandleArchiving($defs{$_},1) } devspec2array("TYPE=FileLog");
FileLog_dailySwitch($hash); # Forum #42415
map {
FileLog_initEMI($defs{$_}, "filelog-event-min-interval", undef,1);
FileLog_initEMI($defs{$_}, "addLog", undef, 1);
my $mi = $defs{$_}{addLogMinInterval};
InternalTimer(time()+$mi, "FileLog_addLog", $defs{$_}, 0) if($mi);
} devspec2array("TYPE=FileLog");
}, $hash, 0);
}
@ -201,7 +195,14 @@ FileLog_Define($@)
$hash->{logfile} = $a[2];
$hash->{currentlogfile} = $f;
$hash->{STATE} = "active";
InternalTimer(0, sub(){ notifyRegexpChanged($hash, $a[3]); }, $hash);
InternalTimer(0, sub(){
notifyRegexpChanged($hash, $a[3]);
FileLog_initEMI($hash, "filelog-event-min-interval", undef,1);
FileLog_initEMI($hash, "addLog", undef, 1);
my $mi = $hash->{addLogMinInterval};
InternalTimer(time()+$mi, "FileLog_addLog", $hash, 0) if($mi);
}, $hash);
return undef;
}