Skip to content

Commit c9f67da

Browse files
committed
fix(repo): 记录请求失败的日志
1 parent a9dfcd7 commit c9f67da

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

laravel/app/Http/Repository/MultithreadingRepository.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ public function newLoadExcel()
235235

236236
// 3. 循环数组每个单元格的数据
237237
$this->dataSet['data'] = $data;
238-
Log::info('excel-data: ', $this->dataSet);
239238

240239
return true;
241240
} catch (Exception|\PhpOffice\PhpSpreadsheet\Exception $exception) {
@@ -304,7 +303,9 @@ public function newRequest($url, $appkey)
304303
},
305304
'rejected' => function($reason, $index) {
306305
// this is delivered each failed request
307-
return 'Index: '.$index.' Reason:'.$reason;
306+
Log::error('request-failed: ID-'.$index, ['reason' => $reason]);
307+
$this->data[$index] = [];
308+
//return 'Index: '.$index.' Reason:'.$reason;
308309
},
309310
]);
310311

@@ -319,7 +320,7 @@ public function newRequest($url, $appkey)
319320
$returnArray[$k]['param'] = $this->dataSet['data'][$k];
320321
$returnArray[$k]['result'] = $v;
321322
}
322-
Log::info('return-array', $returnArray);
323+
// Log::info('return-array', $returnArray);
323324
return $returnArray;
324325
}
325326

0 commit comments

Comments
 (0)