Allow checkforupdates to check db if there's nothing in memcached.
Patch by kareila.
diffs (19 lines):
diff -r 3d40feeedb63 -r 744f97686e08 cgi-bin/ljprotocol.pl
--- a/cgi-bin/ljprotocol.pl Mon Jan 31 14:37:24 2011 +0800
+++ b/cgi-bin/ljprotocol.pl Mon Jan 31 19:17:57 2011 +0800
@@ -875,11 +875,12 @@ sub checkforupdates
if (@LJ::MEMCACHE_SERVERS) {
my $tu = LJ::get_timeupdate_multi({ memcache_only => 1 }, @fr);
my $max = 0;
- while ($_ = each %$tu) {
- $max = $tu->{$_} if $tu->{$_} > $max;
+ foreach ( values %$tu ) {
+ $max = $_ if $_ > $max;
}
$update = LJ::mysql_time($max) if $max;
- } else {
+ }
+ unless ( $update ) {
my $dbr = LJ::get_db_reader();
unless ($dbr) {
# rather than return a 502 no-db error, just say no updates,
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog