tangyuanwang пре 1 месец
родитељ
комит
533ce61cbe

+ 11 - 11
app/Jobs/Manager/CollectData/JdTmao/JdTmaoProductDataJobs.php

@@ -147,17 +147,17 @@ class JdTmaoProductDataJobs implements ShouldQueue
                     $ScrapeTmpData->save();
                 }
             }
-            $queue_page =  $item['queue_page']; //页码
-            $queue_now_limit =  $item['queue_now_limit']; //当前处理条数
-            $queue_limit =  $item['queue_limit']; //每页处理条数
-            $queue_total =  $item['queue_total']; //总条数
-            if ($queue_now_limit == $queue_limit) {
-                // //继续执行下一页
-                $message_data['page'] = (int)$queue_page + 1;
-                $message_data['limit'] = $queue_limit;
-                $message_data['total'] = $queue_total;
-                JdTmaoProductJobs::dispatch($message_data);
-            }
+            // $queue_page =  $item['queue_page']; //页码
+            // $queue_now_limit =  $item['queue_now_limit']; //当前处理条数
+            // $queue_limit =  $item['queue_limit']; //每页处理条数
+            // $queue_total =  $item['queue_total']; //总条数
+            // if ($queue_now_limit == $queue_limit) {
+            //     //继续执行下一页
+            //     $message_data['page'] = (int)$queue_page + 1;
+            //     $message_data['limit'] = $queue_limit;
+            //     $message_data['total'] = $queue_total;
+            //     JdTmaoProductJobs::dispatch($message_data);
+            // }
         } catch (\Exception $e) {
             Log::info('job_error', '采集数据-医药城数据处理队列失败', ['data' => $this->message_data, 'error' => $e->getMessage()]);
         }

+ 6 - 0
app/Jobs/Manager/CollectData/JdTmao/JdTmaoProductJobs.php

@@ -86,6 +86,12 @@ class JdTmaoProductJobs implements ShouldQueue
             JdTmaoStoreJobs::dispatch($request_data);
             // JdTmaoStoreJobs::dispatchSync($request_data);
 
+            //继续执行下一页
+            $message_data['page'] = (int)$page + 1;
+            $message_data['limit'] = $limit;
+            $message_data['total'] = $total;
+            JdTmaoProductJobs::dispatch($message_data)->delay(now()->addSeconds(10));//延时10秒执行、防止队列堵塞
+            
             Log::info('job_info', '采集数据-京东天猫数据同步队列日志', ['data' => ['page' => $page, 'limit' => $limit, 'totle' => $total]]);
         } catch (\Exception $e) {
             Log::info('job_error', '采集数据-京东天猫数据同步队列失败', ['error' => $e->getMessage()]);

+ 11 - 11
app/Jobs/Manager/CollectData/Ysbang/YsbangProductDataJobs.php

@@ -121,17 +121,17 @@ class YsbangProductDataJobs implements ShouldQueue
                     $ScrapeTmpData->save();
                 }
             }
-            $queue_page =  $item['queue_page']; //页码
-            $queue_now_limit =  $item['queue_now_limit']; //当前处理条数
-            $queue_limit =  $item['queue_limit']; //每页处理条数
-            $queue_total =  $item['queue_total']; //总条数
-            if ($queue_now_limit == $queue_limit) {
-                // //继续执行下一页
-                $message_data['page'] = (int)$queue_page + 1;
-                $message_data['limit'] = $queue_limit;
-                $message_data['total'] = $queue_total;
-                YsbangProductJobs::dispatch($message_data);
-            }
+            // $queue_page =  $item['queue_page']; //页码
+            // $queue_now_limit =  $item['queue_now_limit']; //当前处理条数
+            // $queue_limit =  $item['queue_limit']; //每页处理条数
+            // $queue_total =  $item['queue_total']; //总条数
+            // if ($queue_now_limit == $queue_limit) {
+            //     //继续执行下一页
+            //     $message_data['page'] = (int)$queue_page + 1;
+            //     $message_data['limit'] = $queue_limit;
+            //     $message_data['total'] = $queue_total;
+            //     YsbangProductJobs::dispatch($message_data);
+            // }
         } catch (\Exception $e) {
             Log::info('job_error', '采集数据-药师帮数据处理队列失败', ['data' => $this->message_data, 'error' => $e->getMessage()]);
         }

+ 6 - 0
app/Jobs/Manager/CollectData/Ysbang/YsbangProductJobs.php

@@ -75,6 +75,12 @@ class YsbangProductJobs implements ShouldQueue
             $request_data['queue_total'] = $total;
             YsbangStoreJobs::dispatch($request_data);
             // YsbangStoreJobs::dispatchSync($request_data);
+
+            $message_data['page'] = (int)$page + 1;
+            $message_data['limit'] = $limit;
+            $message_data['total'] = $total;
+            YsbangProductJobs::dispatch($message_data)->delay(now()->addSeconds(10));//延时10秒执行、防止队列堵塞;
+
             Log::info('job_info', '采集数据-药师帮数据同步队列日志', ['data' => ['page' => $page, 'limit' => $limit, 'totle' => $total]]);
         } catch (\Exception $e) {
             Log::info('job_error', '采集数据-药师帮数据同步队列失败', ['error' => $e->getMessage()]);

+ 11 - 11
app/Jobs/Manager/CollectData/Yycheng/YychengProductDataJobs.php

@@ -123,17 +123,17 @@ class YychengProductDataJobs implements ShouldQueue
                     $ScrapeTmpData->save();
                 }
             }
-            $queue_page =  $item['queue_page']; //页码
-            $queue_now_limit =  $item['queue_now_limit']; //当前处理条数
-            $queue_limit =  $item['queue_limit']; //每页处理条数
-            $queue_total =  $item['queue_total']; //总条数
-            if ($queue_now_limit == $queue_limit) {
-                // //继续执行下一页
-                $message_data['page'] = (int)$queue_page + 1;
-                $message_data['limit'] = $queue_limit;
-                $message_data['total'] = $queue_total;
-                YychengProductJobs::dispatch($message_data);
-            }
+            // $queue_page =  $item['queue_page']; //页码
+            // $queue_now_limit =  $item['queue_now_limit']; //当前处理条数
+            // $queue_limit =  $item['queue_limit']; //每页处理条数
+            // $queue_total =  $item['queue_total']; //总条数
+            // if ($queue_now_limit == $queue_limit) {
+            //     //继续执行下一页
+            //     $message_data['page'] = (int)$queue_page + 1;
+            //     $message_data['limit'] = $queue_limit;
+            //     $message_data['total'] = $queue_total;
+            //     YychengProductJobs::dispatch($message_data);
+            // }
         } catch (\Exception $e) {
             Log::info('job_error', '采集数据-医药城数据处理队列失败', ['data' => $this->message_data, 'error' => $e->getMessage()]);
         }

+ 5 - 0
app/Jobs/Manager/CollectData/Yycheng/YychengProductJobs.php

@@ -77,6 +77,11 @@ class YychengProductJobs implements ShouldQueue
             YychengStoreJobs::dispatch($request_data);
             // YychengStoreJobs::dispatchSync($request_data);
 
+            $message_data['page'] = (int)$page + 1;
+            $message_data['limit'] = $limit;
+            $message_data['total'] = $total;
+            YychengProductJobs::dispatch($message_data)->delay(now()->addSeconds(10)); //延时10秒执行、防止队列堵塞;
+
             Log::info('job_info', '采集数据-医药城数据同步队列日志', ['data' => ['page' => $page, 'limit' => $limit, 'totle' => $total]]);
         } catch (\Exception $e) {
             Log::info('job_error', '采集数据-医药城数据同步队列失败', ['error' => $e->getMessage()]);