[HPOS CLI] Flush in-memory cache after each batch in migration (#44670)
This commit is contained in:
parent
1c9620b3be
commit
0da0e372d6
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: performance
|
||||
|
||||
Improve memory usage in HPOS sync CLI tool.
|
|
@ -219,6 +219,12 @@ class CLIRunner {
|
|||
|
||||
$orders_remaining = count( $this->synchronizer->get_next_batch_to_process( 1 ) ) > 0;
|
||||
$order_count = $remaining_count - $batch_size;
|
||||
|
||||
if ( function_exists( 'wp_cache_supports' ) && wp_cache_supports( 'flush_runtime' ) ) {
|
||||
wp_cache_flush_runtime();
|
||||
}
|
||||
|
||||
$GLOBALS['wpdb']->flush();
|
||||
}
|
||||
|
||||
$progress->finish();
|
||||
|
|
Loading…
Reference in New Issue