]> iEval git - plack-app-gruntmaster.git/commitdiff
Require a delay of 30 seconds between jobs from a single user
authorMarius Gavrilescu <marius@ieval.ro>
Wed, 26 Feb 2014 08:18:37 +0000 (10:18 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 26 Feb 2014 08:26:25 +0000 (10:26 +0200)
lib/Gruntmaster/Page/Submit.pm

index e537765165bb64fe05646d9df0bb26a3df098a3e..569fe9186f38c2cadff58d62af93767f43a4ce61 100644 (file)
@@ -24,6 +24,8 @@ sub generate{
        die if defined $contest && $contest !~ /^\w+$/ ;
        die if defined $contest && (time > contest_end $contest);
        return reply 'A required parameter was not supplied' if grep { !defined } $problem, $format, $prog;
+       return reply 'You must wait 30 seconds between jobs' unless time > lastjob ($r->user) + 30;
+       set_lastjob $r->user;
 
        local $Gruntmaster::Data::contest = $contest if $contest;
 
This page took 0.029725 seconds and 4 git commands to generate.