]> iEval git - gruntmaster-page.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:51 +0000 (10:26 +0200)
(cherry picked from commit 6a9aaf149c09cd2e8ae1332e4f50abbb946870c2)

lib/Gruntmaster/Page/Submit.pm

index 0159a9d06865f7a3f1132324e171bf310a4c748a..a30263bbba5186ffc9fd58ce5b604f66878d9e1b 100644 (file)
@@ -33,6 +33,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.03181 seconds and 4 git commands to generate.