Committer: sbelyaev
LJSUP-9616: Incorrect statistic fix.U trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/ljprotocol.pl =================================================================== --- trunk/cgi-bin/ljprotocol.pl 2011-08-26 04:43:31 UTC (rev 19863) +++ trunk/cgi-bin/ljprotocol.pl 2011-08-26 06:22:25 UTC (rev 19864) @@ -2096,19 +2096,19 @@ LJ::MemCache::incr($key, 1) || (LJ::MemCache::add($key, 0), LJ::MemCache::incr($key, 1)); - - my @ltime = gmtime(time()); + + my $poster_offset = $u->timezone; + my @ltime = gmtime(time() + $poster_offset * 3600); my $current = sprintf("%04d-%02d-%02d %02d:%02d", $ltime[5]+1900, $ltime[4] + 1, $ltime[3], $ltime[2], $ltime[1]); - - if ($eventtime ge $current) { + if ($eventtime gt $current) { my $key_future = "stat:opt_backdated:future:$state_date"; LJ::MemCache::incr($key_future, 1) || - (LJ::MemCache::add($key_future, 0), LJ::MemCache::incr($key, 1)); + (LJ::MemCache::add($key_future, 0), LJ::MemCache::incr($key_future, 1)); } }