From: Marius Gavrilescu Date: Wed, 29 Jan 2014 16:58:00 +0000 (+0200) Subject: Add contest support X-Git-Tag: 5999.000_001~26 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=cfb728e8fd9f99459af9851fb9901f3e9b82957e;p=gruntmaster-daemon.git Add contest support --- diff --git a/lib/Gruntmaster/Daemon.pm b/lib/Gruntmaster/Daemon.pm index 73610b3..3b3f5be 100644 --- a/lib/Gruntmaster/Daemon.pm +++ b/lib/Gruntmaster/Daemon.pm @@ -141,8 +141,10 @@ sub process{ } sub got_job{ - my $job = shift; - get_logger->debug("Taking job $job..."); + $_[0] =~ /^(\w*)\.(\d+)$/; + my $job = $2; + $Gruntmaster::Data::contest = $1 if $1; + get_logger->debug("Taking job $job@{[defined $1 ? \" of contest $1\" : '']}..."); if (set_job_daemon $job, hostname . ":$$") { get_logger->debug("Succesfully taken job $job"); process $job;