Jun 22, 2022
0
Level 8
HTTP calls, slows after a few days
I'm making calls to a API for a commercial application, gathering information about our trucks on the road. It seems to me that the calls slowly get slower and slower until after 5 days they start to time out. You can see one of the calls below, i had to put a 65 seconds timeout or the frequency will be 2 or 3 days. I have to create a new user, on the app, to solve the problem. I have talked to support and they don't see any problem with the calls, nor there is throttling on the interface. Has anyone experience similar problem?
/**
* Returns all routes for a date
* @param Carbon $date
* @return Collection
* @throws Exception
*/
public function getAllRoutes(Carbon $date)
{
$criteria = '{
"filters": [
"*",
"origin"
]
}
';
return
Http::timeout(65)->withHeaders($this->headers)
->post($this->baseSite . 'Route/filter?criteria=' . urlencode($criteria), [
'date' => $date->format('Y-m-d'),
])
->collect();
}
Please or to participate in this conversation.