Fixed Guzzle 30000ms error and improve cache usage

This commit is contained in:
2026-06-30 20:07:38 +02:00
parent aefe03ed67
commit 8ca82fd0c8
2 changed files with 22 additions and 16 deletions

View File

@@ -25,7 +25,7 @@ class XenforoApiService {
*/
private function get(string $endpoint, ?int $customUserId = null ): mixed
{
$response = Http::timeout(30)->withOptions(['verify' => false])->withHeaders([
$response = Http::timeout(8)->connectTimeout(4)->withOptions(['verify' => false])->withHeaders([
'XF-Api-Key' => $this->apiKey,
'XF-Api-User' => $customUserId ?? $this->superUserId,
])->get("{$this->apiUrl}/{$endpoint}");
@@ -40,7 +40,7 @@ class XenforoApiService {
private function post(string $endpoint, ?int $customUserId = null, array $data = [] ): mixed
{
$response = Http::timeout(30)->withOptions(['verify' => false])->withHeaders([
$response = Http::timeout(8)->connectTimeout(4)->withOptions(['verify' => false])->withHeaders([
'XF-Api-Key' => $this->apiKey,
'XF-Api-User' => $customUserId ?? $this->superUserId,
])->post("{$this->apiUrl}/{$endpoint}", $data);
@@ -55,7 +55,7 @@ class XenforoApiService {
private function delete(string $endpoint, ?int $customUserId = null, array $data = [] ): mixed
{
$response = Http::timeout(30)->withOptions(['verify' => false])->withHeaders([
$response = Http::timeout(8)->connectTimeout(4)->withOptions(['verify' => false])->withHeaders([
'XF-Api-Key' => $this->apiKey,
'XF-Api-User' => $customUserId ?? $this->superUserId,
])->delete("{$this->apiUrl}/{$endpoint}", $data);