Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行php start.php时过一段时间就报错,请问怎么处理 #23

Open
ayamzh opened this issue Jul 23, 2019 · 3 comments
Open

执行php start.php时过一段时间就报错,请问怎么处理 #23

ayamzh opened this issue Jul 23, 2019 · 3 comments

Comments

@ayamzh
Copy link

ayamzh commented Jul 23, 2019

error:Operation timed out after 60078 milliseconds with 0 out of -1 bytes received

@lwp145
Copy link

lwp145 commented Sep 10, 2019

修改/src/ApolloCllient.php中超时时间大于60秒 protected $intervalTimeout = 80

@MengShaoying
Copy link

我也遇到这个问题了。我查了一些材料后发现这个错误是PHP的CURL下载超时导致,通过curl_setopt($ch, CURLOPT_TIMEOUT, 0);去除超时限制可以去掉这个提示。但是setIntervalTimeout($intervalTimeout)方法的实现是:

    public function setIntervalTimeout($intervalTimeout) {
        $intervalTimeout = intval($intervalTimeout);
        if ($intervalTimeout < 1 || $intervalTimeout > 300) {
            return;
        }
        $this->intervalTimeout = $intervalTimeout;
    }

也就是说无法通过正常的设置将超时时间设为0。不清楚作者当初将这个超时限制为1到300秒是出于什么样的考虑?@xiaodx12

@michael23-24
Copy link

michael23-24 commented Sep 27, 2020

CURLOPT_TIMEOUT是接收数据等待时间。start方法的CURLOPT_TIMEOUT没有包裹在trycatch里面,接收超时后会抛出异常,造成中断。apollo服务端会保持连接60秒。所以把intervalTimeout设置为大于60就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants