PluginProbe
ووسلام – همگام سازی ووکامرس و باسلام / 1.10.22
ووسلام – همگام سازی ووکامرس و باسلام v1.10.22
1.10.22 1.10.21 1.10.19 1.10.20 1.10.18 1.10.17 1.10.15 1.10.14 1.10.13 1.10.12 1.10.10 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.2 1.9.1 1.9.0 1.8.8 All 55 releases
← All changes | JobManager.php +19 -0 1.10.19 → 1.10.22 View file →
@@ -65,8 +65,27 @@
65 65 {
66 66 return $this->getCountJobs(['status' => 'processing']) > 0;
67 67 }
68 68
69 + public function getProductUpdateStatus(): array
70 + {
71 + $quickJob = $this->getJob(['job_type' => 'sync_basalam_bulk_update_products', 'status' => 'processing'])
72 + ?: $this->getJob(['job_type' => 'sync_basalam_bulk_update_products', 'status' => 'pending']);
73 + $fullJob = $this->getJob(['job_type' => 'sync_basalam_update_all_products', 'status' => 'processing'])
74 + ?: $this->getJob(['job_type' => 'sync_basalam_update_all_products', 'status' => 'pending']);
75 + $singleCount = $this->getCountJobs([
76 + 'job_type' => 'sync_basalam_update_single_product',
77 + 'status' => ['pending', 'processing'],
78 + ]);
79 +
80 + return [
81 + 'active' => (bool) ($quickJob || $fullJob || $singleCount > 0),
82 + 'type' => $quickJob ? 'quick' : (($fullJob || $singleCount > 0) ? 'full' : ''),
83 + 'status' => $quickJob ? $quickJob->status : ($fullJob ? $fullJob->status : ''),
84 + 'count' => $singleCount,
85 + ];
86 + }
87 +
69 88 public function hasPendingOrStaleProcessingJobs(int $staleProcessingTimeoutSeconds = 120): bool
70 89 {
71 90 global $wpdb;
72 91