改进 工单推送
This commit is contained in:
parent
286d28140b
commit
ab77381c84
@ -52,7 +52,6 @@ public function handle(): void
|
||||
|
||||
|
||||
$success = false;
|
||||
|
||||
try {
|
||||
$response = $workOrder->module->http()->retry(3, 100)->post('work-orders', $workOrder->toArray());
|
||||
|
||||
@ -61,10 +60,14 @@ public function handle(): void
|
||||
'work_order_id' => $workOrder->id,
|
||||
'response' => $response->body(),
|
||||
]);
|
||||
$workOrder->status = 'error';
|
||||
} else {
|
||||
$success = true;
|
||||
}
|
||||
} catch (RequestException $e) {
|
||||
Log::warning($e->getMessage());
|
||||
}
|
||||
|
||||
if (!$success) {
|
||||
$workOrder->status = 'error';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user