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 | includes/Admin/Product/Services/ProductSyncService.php +18 -4 1.10.13 → 1.10.22 View file →
@@ -103,12 +103,26 @@
103 103 }
104 104 }
105 105 }
106 106
107 - public function enqueueAutoConnect($cursor = null): void
108 - {
109 - $payload['cursor'] = $cursor;
110 - $data = $this->jobManager->createJob(
107 + public function enqueueAutoConnect($cursor = null): void
108 + {
109 + $pendingJob = $this->jobManager->getJob([
110 + 'job_type' => self::JOB_TYPE_AUTO_CONNECT,
111 + 'status' => 'pending',
112 + ]);
113 + $processingJob = $this->jobManager->getJob([
114 + 'job_type' => self::JOB_TYPE_AUTO_CONNECT,
115 + 'status' => 'processing',
116 + ]);
117 +
118 + if ($pendingJob || $processingJob) return;
119 +
120 + $payload = ['mode' => 'vendor'];
121 + if ($cursor !== null) {
122 + $payload['cursor'] = $cursor;
123 + }
124 + $data = $this->jobManager->createJob(
111 125 self::JOB_TYPE_AUTO_CONNECT,
112 126 'pending',
113 127 json_encode($payload)
114 128 );