Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dan3460's avatar

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();
    }
0 likes
0 replies

Please or to participate in this conversation.