performance: checks fo $this->data_synchronizer->data_sync_is_enabled… (#46616)
* performance: checks fo $this->data_synchronizer->data_sync_is_enabled() before executing $this->data_synchronizer->get_sync_status() * Update plugins/woocommerce/src/Internal/Utilities/COTMigrationUtil.php Fix code style issues * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
This commit is contained in:
parent
48f2a4c5ad
commit
05a728ff03
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: performance
|
||||
|
||||
Avoid unnecessary query when HPOS compatibility mode is disabled.
|
|
@ -74,8 +74,12 @@ class COTMigrationUtil {
|
|||
* @return bool
|
||||
*/
|
||||
public function is_custom_order_tables_in_sync() : bool {
|
||||
if ( ! $this->data_synchronizer->data_sync_is_enabled() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$sync_status = $this->data_synchronizer->get_sync_status();
|
||||
return 0 === $sync_status['current_pending_count'] && $this->data_synchronizer->data_sync_is_enabled();
|
||||
return 0 === $sync_status['current_pending_count'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue