From cb429c388f9ba921ee95c1998940be6a6cc62bf8 Mon Sep 17 00:00:00 2001 From: Jamie McCarthy Date: Sun, 5 Jun 2005 00:25:08 +0000 Subject: [PATCH] Bugfix --- Slash/DB/MySQL/MySQL.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Slash/DB/MySQL/MySQL.pm b/Slash/DB/MySQL/MySQL.pm index db8fd2df8..a594afc33 100644 --- a/Slash/DB/MySQL/MySQL.pm +++ b/Slash/DB/MySQL/MySQL.pm @@ -4845,22 +4845,22 @@ sub checkPostInterval { $speedlimit = int($speedlimit + 0.5); } + my $time = $self->getTime({ unix_format => 1 }); my $timeframe = $constants->{formkey_timeframe}; $timeframe = $speedlimit if $speedlimit > $timeframe; - my $formkey_earliest = getTime({ unix_format => 1 }) - $timeframe; + my $formkey_earliest = $time - $timeframe; my $where = $self->_whereFormkey(); $where .= " AND formname = '$formname' "; $where .= "AND ts >= $formkey_earliest"; - my $now = time(); my($interval) = $self->sqlSelect( - "$now - MAX(submit_ts)", + "$time - MAX(submit_ts)", "formkeys", $where); $interval ||= 0; - print STDERR "CHECK INTERVAL $interval speedlimit $speedlimit al2_used $al2_name_used\n" if $constants->{DEBUG}; + print STDERR "CHECK INTERVAL $interval speedlimit $speedlimit al2_used $al2_name_used f_e $formkey_earliest\n" if $constants->{DEBUG}; return ($interval < $speedlimit && $speedlimit > 0) ? $interval : 0; }