Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal-Omega authored Feb 23, 2024
1 parent 3f409f2 commit ba572a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions includes/WikiDiscoverRandom.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ public static function randomWiki( $state = 0, $category = 0, $language = 0 ) {
$conditions['wiki_inactive'] = 0;
}

/* Never randomly offer closed or private wikis */
// Never randomly offer closed or private wikis
if ( $config->get( 'CreateWikiUseClosedWikis' ) ) {
$conditions['wiki_closed'] = 0;
}

if ( $config->get( 'CreateWikiUsePrivateWikis' ) ) {
$conditions['wiki_private'] = 0;
}
Expand All @@ -50,7 +51,7 @@ protected static function randFromConds( $conds ) {
$dbr = $lbFactory->getMainLB( $config->get( 'CreateWikiDatabase' ) )
->getMaintenanceConnectionRef( DB_REPLICA, [], $config->get( 'CreateWikiDatabase' ) );

/* MySQL is ever the outlier */
// MySQL is ever the outlier
$random_function = $dbr->getType() === 'mysql' ? 'RAND()' : 'random()';

return $dbr->selectRow(
Expand Down

0 comments on commit ba572a4

Please sign in to comment.