Fixed Guzzle 30000ms error and improve cache usage
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user