Skip to content

Commit 61cd15d

Browse files
committed
Replace hardcoded value with class constant and bump the limit to 11k
1 parent 59634cc commit 61cd15d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

includes/wp-cli/class-orchestrate-sites.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515
class Orchestrate_Sites extends \WP_CLI_Command {
1616
const RUNNER_HOST_HEARTBEAT_KEY = 'a8c_cron_control_host_heartbeats';
17+
const MAX_SITES = 11000;
1718

1819
/**
1920
* Record a heartbeat
@@ -61,12 +62,12 @@ public function list() {
6162
*/
6263
private function display_sites( $num_groups = 1, $group = 0 ) {
6364
$site_count = get_sites( [ 'count' => 1 ] );
64-
if ( $site_count > 10000 ) {
65-
trigger_error( 'Cron-Control: This multisite has more than 10000 subsites, currently unsupported.', E_USER_WARNING );
65+
if ( $site_count > self::MAX_SITES ) {
66+
trigger_error( 'Cron-Control: This multisite has more than ' . self::MAX_SITES . ' subsites, currently unsupported.', E_USER_WARNING );
6667
}
6768

6869
// Keep the query simple, then process the results.
69-
$all_sites = get_sites( [ 'number' => 10000 ] );
70+
$all_sites = get_sites( [ 'number' => self::MAX_SITES ] );
7071
$sites_to_display = [];
7172
foreach ( $all_sites as $index => $site ) {
7273
if ( $index % $num_groups !== $group ) {

0 commit comments

Comments
 (0)