KI423DCQYAHL7IRSLKYU6BR5VMEGETWSKUANU4EKZEDWC2S2XSHAC
KLSDJV75BBXGL6KJYM23INJZCIIN6JKPP6I2UPJ6P4NPGQUIWAWAC
CNEQ7L4GUZRSS5VTNVW5PRXHASWGYFNW7YTSHIBOFNM7C454NH5AC
WXV6M6XNOKHBGKDFUBKQ5FJTLO6PLZHXHJW44O6BVVIHER2FIQWAC
LBNVQXUBEZ45SOTGVXK5UEZXIAIZTJLWZNUYFI4JZ6J65N3KPDVQC
Q24QXGSMSBGB32S45SNOJO2ZDXEDRZQ2OGYVDVOH4I3QCAWSSIAQC
6F4UNDTCAW7LYSKTUUUCX32BLAAGYPUPK2LXMMZ32Y6H3CBWP6TQC
MMDLWWZ2W2XVHHOTG2S5XCPITVNIJQ6F7GLCF2MKQANFNFEID7DAC
J5UVLXOK6EDIL5I7VKWH4V2QDS4DPD7FHRK6XBWSXFRQS4JKXFZQC
D5QIOJGPKQJIYBUCSC3MFJ3TXLPNZ2XMI37GXMFRVRFWWR2VMTFAC
my $size = stat($logPath)->size;
error($c, "This build log is too big to display ($size bytes).")
if $size >= 64 * 1024 * 1024;
# Don't send logs that we can't stream.
my $size = stat($logPath)->size; # FIXME: not so meaningful for compressed logs
error($c, "This build log is too big to display ($size bytes).") unless
$mode eq "raw"
|| (($mode eq "tail" || $mode eq "tail-reload") && $logPath !~ /\.bz2$/)
|| $size < 64 * 1024 * 1024;
package Hydra::View::NixLog;
use strict;
use base qw/Catalyst::View/;
use Hydra::Helper::CatalystUtils;
sub process {
my ($self, $c) = @_;
my $logPath = $c->stash->{logPath};
$c->response->content_type('text/plain');
my $fh = new IO::Handle;
if ($logPath =~ /\.bz2$/) {
open $fh, "bzip2 -dc < '$logPath' |" or die;
} else {
open $fh, "<$logPath" or die;
}
binmode($fh);
setCacheHeaders($c, 365 * 24 * 60 * 60);
$c->response->body($fh);
return 1;
}
1;