# HG changeset patch # User devi # Date 1135245366 -7200 # Node ID d3fcff5e375752452dbd32d18fce39275c4b6600 # Parent f1ba68510fed581f59f9b6596ae277c4c5087cdf mywi ответы кэшируются + подсветка для записей с хинтами diff -r f1ba68510fed -r d3fcff5e3757 l3-frontend --- a/l3-frontend Thu Dec 22 08:30:38 2005 +0200 +++ b/l3-frontend Thu Dec 22 11:56:06 2005 +0200 @@ -23,6 +23,9 @@ our %Stat; our %CommandsFDistribution; # Сколько раз в журнале встречается какая команда +my %mywi_cache_for; # Кэш для экономии обращений к mywi + + sub search_buy; sub make_comment; sub load_command_lines_from_xml; @@ -150,7 +153,7 @@ my $cline = $_[0]; #my $files = $_[1]; - my @comments=(); + my @comments; my @commands = keys %{extract_from_cline("commands", $cline)}; my @args = keys %{extract_from_cline("args", $cline)}; return if (!@commands && !@args); @@ -161,9 +164,8 @@ $command =~ s/'//g; $CommandsFDistribution{$command}++; if (!$Commands_Description{$command}) { - my $mywi=""; - $mywi = mywi_client ($command) || ""; - $mywi = join ("\n", grep(/\([18]\)/, split(/\n/, $mywi))); + $mywi_cache_for{$command} ||= mywi_client ($command) || ""; + my $mywi = join ("\n", grep(/\([18]\)/, split(/\n/, $mywi_cache_for{$command}))); $mywi =~ s/\s+/ /; if ($mywi !~ /^\s*$/) { $Commands_Description{$command} = $mywi; @@ -576,7 +578,8 @@ #$cline .= "(".$Sessions{$cl->{local_session_id}}.")"; my $hint = make_comment($cl->{"cline"}); - $cline = "
$cline
" if $hint; + $cline = "$cline" if $hint; + $cline = "$cline" if !$hint; $Result{"body"} .= $cline; $Result{"body"} .= "\n"; diff -r f1ba68510fed -r d3fcff5e3757 l3config.pm --- a/l3config.pm Thu Dec 22 08:30:38 2005 +0200 +++ b/l3config.pm Thu Dec 22 11:56:06 2005 +0200 @@ -60,7 +60,7 @@ "frontend_local_ico" => "/l3/freebsd.ico", "mywi_server" => "127.0.0.1", - "mywi_port" => "19800", + "mywi_port" => "19801", "stat_inactivity_interval" => "1800",