From 1acbe467159a0b7435602270342143b88b916dbf Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Wed, 26 Feb 2014 10:18:37 +0200 Subject: [PATCH] Require a delay of 30 seconds between jobs from a single user (cherry picked from commit 6a9aaf149c09cd2e8ae1332e4f50abbb946870c2) --- lib/Gruntmaster/Page/Submit.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Gruntmaster/Page/Submit.pm b/lib/Gruntmaster/Page/Submit.pm index 0159a9d..a30263b 100644 --- a/lib/Gruntmaster/Page/Submit.pm +++ b/lib/Gruntmaster/Page/Submit.pm @@ -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; -- 2.39.2