Skip to content

Commit

Permalink
Title: Bump page_random updates from ~9% to 10%
Browse files Browse the repository at this point in the history
Both ends of mt_rand() are inclusive, so mt_rand( 0, 10 ) can return
eleven different numbers, not ten.

Bug: T309477
Change-Id: Ibab923f7ac13a81bde18e40ac9cca0a428a0e07f
Follows-Up: Iab493555c2c343f69a77cc2fb48f5c06407579fc
  • Loading branch information
lucaswerkmeister committed Jan 10, 2024
1 parent 230a8f6 commit e841447
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/title/Title.php
Original file line number Diff line number Diff line change
Expand Up @@ -3412,7 +3412,7 @@ function ( IDatabase $dbw, $fname ) use ( $conds, $purgeTime ) {
->where( $conds )
->andWhere( $dbw->expr( 'page_touched', '<', $dbTimestamp ) );

if ( mt_rand( 0, 10 ) === 1 ) {
if ( mt_rand( 1, 10 ) === 1 ) {
$update->andSet( [ 'page_random' => wfRandom() ] );
}

Expand Down

0 comments on commit e841447

Please sign in to comment.