From fee71502a5604c96691fd82bfc5e1b5fb55ff393 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Wed, 27 Nov 2013 22:58:05 +0200 Subject: [PATCH] Add contest (multispace) support --- lib/Gruntmaster/Daemon.pm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/Gruntmaster/Daemon.pm b/lib/Gruntmaster/Daemon.pm index bc2518e..ebab95c 100644 --- a/lib/Gruntmaster/Daemon.pm +++ b/lib/Gruntmaster/Daemon.pm @@ -118,23 +118,23 @@ sub process{ # Clean up get_logger->info("Job result: " . $meta->{result_text}); delete $meta->{files}{$_}{run} for keys $meta->{files}; - $meta->{date} = time; $meta->{results} = \@full_results if scalar @full_results; DumpFile "meta.yml", $meta; for (<*>) { unlink $_ unless $_ eq 'in' || $_ eq 'meta.yml' || ($_ eq 'compile-error' && -s); } chdir '../..'; - mkdir 'log' unless -d 'log'; - IO::File->new('>log/meta.yml')->close unless -f 'log/meta.yml'; - flock my $logmetafh = IO::File->new('{contest} ? "ct/$meta->{contest}/log" : 'log'; + mkdir $log unless -d $log; + IO::File->new(">$log/meta.yml")->close unless -f "$log/meta.yml"; + flock my $logmetafh = IO::File->new("<$log/meta.yml"), LOCK_EX; + my $logmeta = LoadFile "$log/meta.yml"; $logmeta->{last}++; - rename $dir, 'log/' . $logmeta->{last}; - generate 'log/' . $logmeta->{last} . '/index.html'; - DumpFile 'log/meta.yml', $logmeta; + rename $dir, "$log/$logmeta->{last}"; + generate "$log/$logmeta->{last}/index.html"; + DumpFile "$log/meta.yml", $logmeta; undef $logmetafh; - generate 'log/index.html' + generate "$log/index.html" } sub run{ -- 2.39.2