W
W
WebDev2016-11-18 14:16:23
In contact with
WebDev, 2016-11-18 14:16:23

Do requests to the VK API hang periodically?

Through the VKontakte API I made authorization.
This is the kind of code

$data = [
                'client_id'     => $clientId,
                'redirect_uri'  => route('vkontakte'),
                'client_secret' => $secretKey,
                'code'          => $code,
            ];

            $query = http_build_query($data);

                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, 'https://oauth.vk.com/access_token?' . $query);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                $json = curl_exec($ch);
                curl_close($ch);

Everything worked fine, but recently, periodically, this request in VK began to freeze. And the script is interrupted by a timeout. This happens absolutely randomly, if you run it next, it can work out instantly. What can be wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question