Skip to content

Commit

Permalink
Update class-sv-wp-background-job-handler.php
Browse files Browse the repository at this point in the history
Make this more efficient. 

While awaiting a dedicated database table where no LIKE queries ever will be needed.
  • Loading branch information
ramonfincken authored Mar 21, 2024
1 parent 4466b59 commit 1c2fb1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion woocommerce/utilities/class-sv-wp-background-job-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,11 @@ protected function is_queue_empty() {
$processing = '%"status":"processing"%';

$count = $wpdb->get_var( $wpdb->prepare( "
SELECT COUNT(*)
SELECT COUNT(option_id)
FROM {$wpdb->options}
WHERE option_name LIKE %s
AND ( option_value LIKE %s OR option_value LIKE %s )
LIMIT 1
", $key, $queued, $processing ) );

return ( $count > 0 ) ? false : true;
Expand Down

0 comments on commit 1c2fb1a

Please sign in to comment.