From c7b595598f43858f3170be2f2a48f7e7e7a42ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=B8=96=E7=95=8C?= <642747453@qq.com> Date: Tue, 8 Nov 2022 10:26:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20#10000=20=E6=89=B9=E9=87=8F=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Imports/InventoryImport.php | 1 + app/Services/Business/BusinessClient.php | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Imports/InventoryImport.php b/app/Imports/InventoryImport.php index 4e087b4..1feb3e6 100644 --- a/app/Imports/InventoryImport.php +++ b/app/Imports/InventoryImport.php @@ -73,6 +73,7 @@ class InventoryImport implements ToCollection, SkipsEmptyRows $goodsSku->stock = 0; $goodsSku->save(); } + sleep(2); event(new StockUpdateEvent($onSkuIds, 1)); } } diff --git a/app/Services/Business/BusinessClient.php b/app/Services/Business/BusinessClient.php index 90c47af..f1e7ba4 100644 --- a/app/Services/Business/BusinessClient.php +++ b/app/Services/Business/BusinessClient.php @@ -12,6 +12,7 @@ use App\Models\Shop; use GuzzleHttp\Client; use Illuminate\Support\Facades\Auth; use GuzzleHttp\Promise; +use Illuminate\Support\Facades\Log as LogFile; abstract class BusinessClient { @@ -163,6 +164,7 @@ abstract class BusinessClient public function batchAsyncPostRequest($url, $batchParams) { + LogFile::info(json_encode($batchParams, 256)); $client = new Client(); $promises = []; foreach ($batchParams as $param) { @@ -172,10 +174,9 @@ abstract class BusinessClient ]; $promises[] = $client->postAsync($url, $options); } - Promise\Utils::unwrap($promises); -// $res = Promise\Utils::unwrap($promises); -// foreach ($res as $item) { -// var_dump($item->getBody()->getContents()); -// } + $res = Promise\Utils::unwrap($promises); + foreach ($res as $item) { + LogFile::info($item->getBody()->getContents()); + } } }