92_FileLog.pm: offset by one for initial HandleArchiving (Forum #39792)

git-svn-id: https://svn.fhem.de/fhem/trunk@9065 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-08-13 18:09:42 +00:00
parent 6429bb41e3
commit 611a0c3a04
3 changed files with 6 additions and 5 deletions

View File

@ -47,7 +47,7 @@ FileLog_Initialize($)
$data{FWEXT}{"/FileLog_logWrapper"}{CONTENTFUNC} = "FileLog_logWrapper"; $data{FWEXT}{"/FileLog_logWrapper"}{CONTENTFUNC} = "FileLog_logWrapper";
InternalTimer(time()+0.1, sub() { # Forum #39792 InternalTimer(time()+0.1, sub() { # Forum #39792
map { HandleArchiving($defs{$_}) } devspec2array("TYPE=FileLog"); map { HandleArchiving($defs{$_},1) } devspec2array("TYPE=FileLog");
}, $hash, 0); }, $hash, 0);
} }

View File

@ -61,7 +61,7 @@ sub FmtTime($);
sub GetLogLevel(@); sub GetLogLevel(@);
sub GetTimeSpec($); sub GetTimeSpec($);
sub GlobalAttr($$$$); sub GlobalAttr($$$$);
sub HandleArchiving($); sub HandleArchiving($;$);
sub HandleTimeout(); sub HandleTimeout();
sub IOWrite($@); sub IOWrite($@);
sub InternalTimer($$$$); sub InternalTimer($$$$);
@ -3104,9 +3104,9 @@ myrename($$)
##################################### #####################################
# Make a directory and its parent directories if needed. # Make a directory and its parent directories if needed.
sub sub
HandleArchiving($) HandleArchiving($;$)
{ {
my ($log) = @_; my ($log,$diff) = @_;
my $ln = $log->{NAME}; my $ln = $log->{NAME};
return if(!$attr{$ln}); return if(!$attr{$ln});
@ -3139,6 +3139,7 @@ HandleArchiving($)
closedir(DH); closedir(DH);
my $max = int(@files)-$nra; my $max = int(@files)-$nra;
$max -= $diff if($diff);
for(my $i = 0; $i < $max; $i++) { for(my $i = 0; $i < $max; $i++) {
if($ard) { if($ard) {
Log 2, "Moving $files[$i] to $ard"; Log 2, "Moving $files[$i] to $ard";

View File

@ -314,7 +314,7 @@ svg_init(par) // also called directly from perl, in race condition
var ed = e.getSVGDocument(); var ed = e.getSVGDocument();
if(src.indexOf("SVG_showLog") < 0 || !ed) if(src.indexOf("SVG_showLog") < 0 || !ed)
return; return;
var sTag = $("svg", ed)[0]; var sTag = $("svg", ed)[0]; // "not well-formed" warning in FireFox
if((par && $(sTag).attr("id") != par)) if((par && $(sTag).attr("id") != par))
return; return;
svg_init_one(e, sTag); svg_init_one(e, sTag);