Answer the question
In order to leave comments, you need to log in
How to send more than 1000 HTTP requests and get a fast response?
problem:
How to send more than 1000 HTTP requests and get a response quickly?
So far I have this code:
$contacts = Contacts::all();
foreach ($contacts as $contact) {
$response = Http::get('https://site.com/api/status', [
'key' => $contact->key,
'email' => $contact->email
]);
$response = json_decode($response);
$status = (isset($response->result->status) ? 'Yes' : 'No');
$sts = $this->find($contact->id);
$sts->status = $status;
$sts->save();
}
return response()->json(['success' => 'Status Ok'],200);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question