From 614f07755a1f6c699e2a46697131810658d3ecc6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 30 Aug 2013 20:44:04 +0000 Subject: [PATCH] Don't show logs bigger than 64 MB --- src/lib/Hydra/Controller/Build.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index d5c7d163..167bab12 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -148,6 +148,10 @@ sub showLog { notFound($c, "The build log of derivation ‘$drvPath’ is not available.") unless defined $logPath; + my $size = stat($logPath)->size; + error($c, "This build log is too big to display ($size bytes).") + if $size >= 64 * 1024 * 1024; + if (!$mode) { # !!! quick hack my $pipeline = ($logPath =~ /.bz2$/ ? "bzip2 -d < $logPath" : "cat $logPath")