|
@@ -19,7 +19,7 @@ class ProcessWMSDataJob implements ShouldQueue
|
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
|
|
|
|
protected $data;
|
|
protected $data;
|
|
|
- public $timeout = 30;
|
|
|
|
|
|
|
+ public $timeout = 60;
|
|
|
|
|
|
|
|
public function __construct($data)
|
|
public function __construct($data)
|
|
|
{
|
|
{
|
|
@@ -32,8 +32,10 @@ class ProcessWMSDataJob implements ShouldQueue
|
|
|
try {
|
|
try {
|
|
|
list($bool, $msg) = $this->settle();
|
|
list($bool, $msg) = $this->settle();
|
|
|
if(! $bool) $this->finalDo($msg);
|
|
if(! $bool) $this->finalDo($msg);
|
|
|
|
|
+ Log::channel('queue_daily')->info('队列执行任务');
|
|
|
} catch (\Throwable $e) {
|
|
} catch (\Throwable $e) {
|
|
|
$this->finalDo("异常:" . $e->getMessage());
|
|
$this->finalDo("异常:" . $e->getMessage());
|
|
|
|
|
+ Log::channel('queue_daily')->info('队列异常', ['msg' => $e->getMessage() . '|' . $e->getLine()]);
|
|
|
$this->delete();
|
|
$this->delete();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -280,7 +282,7 @@ class ProcessWMSDataJob implements ShouldQueue
|
|
|
|
|
|
|
|
public function post_helper($url, $data, $header = [], $timeout = 30)
|
|
public function post_helper($url, $data, $header = [], $timeout = 30)
|
|
|
{
|
|
{
|
|
|
- Log::channel('apiLog')->info('WMS_POST_START', ["api" => $url, "param" => $data]);
|
|
|
|
|
|
|
+ Log::channel('apiLog')->info('入参', ["api" => $url, "param" => $data]);
|
|
|
|
|
|
|
|
$ch = curl_init();
|
|
$ch = curl_init();
|
|
|
curl_setopt($ch, CURLOPT_URL, $url);
|
|
curl_setopt($ch, CURLOPT_URL, $url);
|
|
@@ -296,13 +298,13 @@ class ProcessWMSDataJob implements ShouldQueue
|
|
|
if ($r === false) {
|
|
if ($r === false) {
|
|
|
$errorMessage = curl_error($ch);
|
|
$errorMessage = curl_error($ch);
|
|
|
curl_close($ch);
|
|
curl_close($ch);
|
|
|
- Log::channel('apiLog')->error('WMS_CURL_ERROR', ["msg" => $errorMessage]);
|
|
|
|
|
|
|
+ Log::channel('apiLog')->error('CURL错误', ["msg" => $errorMessage]);
|
|
|
return [false, "网络错误: " . $errorMessage];
|
|
return [false, "网络错误: " . $errorMessage];
|
|
|
}
|
|
}
|
|
|
curl_close($ch);
|
|
curl_close($ch);
|
|
|
|
|
|
|
|
$return = json_decode($r, true);
|
|
$return = json_decode($r, true);
|
|
|
- Log::channel('apiLog')->info('WMS_POST_RETURN', ["res" => $return]);
|
|
|
|
|
|
|
+ Log::channel('apiLog')->info('出参', ["res" => $return]);
|
|
|
|
|
|
|
|
// 判断逻辑:code 存在且为 200 才算 true
|
|
// 判断逻辑:code 存在且为 200 才算 true
|
|
|
if (isset($return['code']) && $return['code'] == 200) {
|
|
if (isset($return['code']) && $return['code'] == 200) {
|