Browse Source

提示提交

ajun 4 years ago
parent
commit
a0e4192c14
2 changed files with 4 additions and 3 deletions
  1. 3 2
      app/Http/Controllers/TestController.php
  2. 1 1
      app/Services/OrderPackageService.php

+ 3 - 2
app/Http/Controllers/TestController.php

@@ -585,7 +585,8 @@ sql;
     {
         $last_start_key = config('sync.order_sync.cache_prefix.last_start_at');
         $last_end_key = config('sync.order_sync.cache_prefix.last_end_at');
-
+        ini_set('max_execution_time',2500);
+        ini_set('memory_limit','1526M');
         $service = new OracleDOCOrderHeaderService();
         $orderService = new OrderService();
         $start_data = Carbon::make('2021-10-12 06:23:37');
@@ -614,7 +615,7 @@ sql;
             $last_end_data  = Carbon::now();
 
             Cache::put($last_start_key,$last_start_data);
-            ValueStore::query()->where('name','order_last_created_sync_at')->update(['value' => $addHeaders->first()->edittime]);
+            ValueStore::query()->where('name','order_last_created_sync_at')->update(['value' => $addHeaders->first()->addtime]);
             ValueStore::query()->where('name','last_order_sync_task_start_at')->update(['value' => $last_start_data]);
             Cache::put($last_end_key,$last_end_data);
             ValueStore::query()->where('name','order_last_updated_sync_at')->update(['value' => $editHeaders->first()->edittime]);

+ 1 - 1
app/Services/OrderPackageService.php

@@ -164,7 +164,7 @@ class OrderPackageService
         /** 批量添加 */
         if (count($inner_params) > 0) {
             try {
-                $inner_array = array_chunk($inner_params, 5000);
+                $inner_array = array_chunk($inner_params, 200);
                 foreach ($inner_array as $params) {
                     $bool = $this->insert($params);
                     $bool ? LogService::log(__METHOD__, __FUNCTION__, '批量添加 OrderPackage ' . count($inner_params) . ' || ' . json_encode($inner_params)) : null;