改进 模块 http 请求部分
This commit is contained in:
parent
b6a87a81c4
commit
be342580a4
@ -10,7 +10,6 @@
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchModule implements ShouldQueue
|
||||
@ -52,7 +51,7 @@ public function handle()
|
||||
try {
|
||||
$response = $module->http()->get('remote');
|
||||
} catch (ConnectException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error('无法连接到模块:' . $module->name, ['error', $e->getMessage()]);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ public function check($module_id = null): bool
|
||||
|
||||
public function http(): PendingRequest
|
||||
{
|
||||
return Http::module($this->api_token, $this->url)->acceptJson();
|
||||
return Http::module($this->api_token, $this->url)->acceptJson()->timeout(5);
|
||||
}
|
||||
|
||||
#[ArrayShape(['transactions' => "array"])]
|
||||
|
Loading…
Reference in New Issue
Block a user