Contoh Membatasi timeout Guzzle
function query2($table, $field, $limit)
{
$client = new Client(['timeout' => 9]); // Reuse existing client from query_umum (assumed)
$headers = ['Content-Type' => 'application/json'];
$body = json_encode([
"selector" => [
"table" => $table,
"data" => $field,
],
"limit" => $limit,
"skip" => 0, // Consider removing if not used
"execution_stats" => true, // Consider removing if not used
]);
$request = new Request('POST', server() . '/_find', $headers, $body);
// $options = [RequestOptions::TIMEOUT => 9];
$response = $client->send($request); // Use synchronous request for simpler code
$data = json_decode($response->getBody(), true)["docs"];
return $data;
}
Lanjut Part : 1
Jam : 15:25:25
Durasi Part : 0:0:1
Durasi Total : 0:0:1
Punya Pertanyaan , Silahkan Whatsapp Langsung
Muhammad Ullil Fahri
WA : 089696380422
Tautan WA : https://wa.me/message/SG4YA2XQP5FPE1
Muhammad Ullil Fahri
WA : 089696380422
Tautan WA : https://wa.me/message/SG4YA2XQP5FPE1