Receives the sent information and then fetches the remote data processing via curl, but with a 5-second limit, sets the
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
After 5 seconds, no news returned, how to deal with it?
Ps:curlopt_timeout default is a few seconds, refers to the time to complete the entire request?
Reply content:
Receives the sent information and then fetches the remote data processing via curl, but with a 5-second limit, sets the
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
After 5 seconds, no news returned, how to deal with it?
Ps:curlopt_timeout default is a few seconds, refers to the time to complete the entire request?
Setup is also useless because the data is disconnected within server 5s.
I think we should set the timeout for fetching remote data to less than 5s, such as 2s. If the time to crawl remote data exceeds, that is timeout. Do a fault-tolerant processing, because in the 5s not to spit out the message, the user will not receive anything.
Writes an asynchronous call. Receive messages, respond immediately, process specific logic asynchronously, and then feedback through customer service messages