| @@ -20,23 +20,9 @@ | ||
| 20 | 20 | $count_of_synced_basalam_products = intval($wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->postmeta} WHERE meta_key = %s", $productIdMetaKey))); |
| 21 | 21 | |
| 22 | 22 | $job_manager = new JobManager(); |
| 23 | 23 | |
| 24 | -$quick_update_processing_job = $job_manager->getJob(['job_type' => 'sync_basalam_bulk_update_products', 'status' => 'processing']) | |
| 25 | - ?: $job_manager->getJob(['job_type' => 'sync_basalam_bulk_update_products', 'status' => 'pending']); | |
| 26 | - | |
| 27 | -$full_update_job = $job_manager->getJob(['job_type' => 'sync_basalam_update_all_products', 'status' => 'pending']); | |
| 28 | -$full_update_processing_job = $job_manager->getJob(['job_type' => 'sync_basalam_update_all_products', 'status' => 'processing']); | |
| 29 | - | |
| 30 | -$single_update_count = $job_manager->getCountJobs(['job_type' => 'sync_basalam_update_single_product', 'status' => ['pending', 'processing']]); | |
| 31 | - | |
| 32 | -$has_active_update_jobs = ($quick_update_processing_job || $full_update_job || $full_update_processing_job || $single_update_count > 0); | |
| 33 | -$active_update_type = ''; | |
| 34 | -if ($quick_update_processing_job) { | |
| 35 | - $active_update_type = 'quick'; | |
| 36 | -} elseif ($full_update_job || $full_update_processing_job || $single_update_count > 0) { | |
| 37 | - $active_update_type = 'full'; | |
| 38 | -} | |
| 24 | +$update_queue_status = $job_manager->getProductUpdateStatus(); | |
| 39 | 25 | |
| 40 | 26 | $create_products_job = $job_manager->getJob(['job_type' => 'sync_basalam_create_all_products', 'status' => 'pending']); |
| 41 | 27 | $create_products_processing_job = $job_manager->getJob(['job_type' => 'sync_basalam_create_all_products', 'status' => 'processing']); |
| 42 | 28 | |