$this->addWhereFld( 'ipb_deleted', 0 );
}
- // Purge expired entries on one in every 10 queries
- if ( !mt_rand( 0, 10 ) ) {
- Block::purgeExpired();
- }
+ # Filter out expired rows
+ $this->addWhere( 'ipb_expiry > ' . $db->addQuotes( $db->timestamp() ) );
$res = $this->select( __METHOD__ );
}
}
+ $flags = $this->persist ? 0 : CachedBagOStuff::WRITE_CACHE_ONLY;
+ $flags |= CachedBagOStuff::WRITE_SYNC; // write to all datacenters
$this->store->set(
wfMemcKey( 'MWSession', (string)$this->id ),
[
'metadata' => $metadata,
],
$metadata['expires'],
- $this->persist ? 0 : CachedBagOStuff::WRITE_CACHE_ONLY
+ $flags
);
$this->metaDirty = false;
case Block::TYPE_IP:
case Block::TYPE_RANGE:
list( $start, $end ) = IP::parseRange( $target );
- $dbr = wfGetDB( DB_SLAVE );
- $conds[] = $dbr->makeList(
+ $conds[] = wfGetDB( DB_SLAVE )->makeList(
[
'ipb_address' => $target,
Block::getRangeCond( $start, $end )