Skip to content

Commit 71ea37f

Browse files
committed
Parsing: When running in a local environment, run the import with --quick to avoid DB replication lag avoidance.
1 parent bbc0c31 commit 71ea37f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

source/wp-content/themes/wporg-developer/inc/cli-commands.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,10 @@ public function parse( $args, $assoc_args ) {
188188
}
189189

190190
// 3. Run the parser.
191+
// If running locally, run a quick parse which skips DB replication-lag sleep()'s
192+
$quick = in_array( wp_get_environment_type(), array( 'local', 'development' ) ) ? '--quick' : '';
191193
WP_CLI::log( 'Running the parser (this will take awhile)...' );
192-
WP_CLI::runcommand( "parser create {$path} --user={$user_id}" );
194+
WP_CLI::runcommand( "parser create {$path} --user={$user_id} {$quick}" );
193195

194196
// 4. Deactivate phpdoc-parser plugin.
195197
WP_CLI::log( 'Deactivating phpdoc-parser plugin...' );

0 commit comments

Comments
 (0)