Pārlūkot izejas kodu

添加启动控制

ajun 5 gadi atpakaļ
vecāks
revīzija
8563b366b5
2 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 2 0
      app/Console/Commands/SyncWMSOrderTask.php
  2. 1 0
      config/sync.php

+ 2 - 0
app/Console/Commands/SyncWMSOrderTask.php

@@ -38,6 +38,8 @@ class SyncWMSOrderTask extends Command
      */
     public function handle()
     {
+        $is_enabled= config('sync.order_sync.cache_prefix.enabled');
+        if(!$is_enabled)return;
         $this->syncCreatedOrder();
         $this->syncUpdatedOrder();
     }

+ 1 - 0
config/sync.php

@@ -9,6 +9,7 @@ return [
         'start_at'=> '',    // 开始同步WMS的时间  时间格式: yyyy-MM-dd HH:mm:ss 如 2020-09-05 13:15:16
     ],
     'order_sync' => [
+        'enabled' => true,
         'interval' => 1,   // 时间以分为单位
         'start_at'=> '',    // 开始同步WMS的时间  时间格式: yyyy-MM-dd HH:mm:ss 如 2020-09-05 13:15:16
         'cache_prefix' => [