* Don't do pretty printing for large logs, because the XSLT processing

is rather slow.
This commit is contained in:
Eelco Dolstra 2009-04-16 15:22:14 +00:00
parent d6bd9bab5f
commit 4d699c97fd

View file

@ -5,6 +5,7 @@ use warnings;
use base 'Hydra::Base::Controller::NixChannel';
use Hydra::Helper::Nix;
use Hydra::Helper::CatalystUtils;
use File::stat;
sub build : Chained('/') PathPart CaptureArgs(1) {
@ -65,6 +66,12 @@ sub showLog {
notFound($c, "Log file $path no longer exists.") unless -f $path;
# Don't do pretty printing for large logs, because the XSLT
# processing is rather slow.
if (!$mode && stat($path)->size >= (256 * 1024)) {
$mode = "raw";
}
if (!$mode) {
# !!! quick hack
my $pipeline = ($path =~ /.bz2$/ ? "cat $path | bzip2 -d" : "cat $path")