From 6a9aaf149c09cd2e8ae1332e4f50abbb946870c2 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 --- 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 e537765..569fe91 100644 --- a/lib/Gruntmaster/Page/Submit.pm +++ b/lib/Gruntmaster/Page/Submit.pm @@ -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; -- 2.39.2