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

如何防止出现 403 问题 #12

Closed
885783558 opened this issue Apr 29, 2016 · 1 comment
Closed

如何防止出现 403 问题 #12

885783558 opened this issue Apr 29, 2016 · 1 comment

Comments

@885783558
Copy link

首先感谢 Ares 的 CurlMulti🙏🏻🙏🏻
问题:在采集中遇到了403,于是想在程序中 sleep,但是不知道应该写在哪??还有最大连接数是不是也要设置小一点??

if ($i < $j) {
    $curl->add(array(
        'url' => "xxx",
        'args' => array (
            'i' => $i,
        ),
    ), 'getSinglePage');

    $i ++;

    sleep(1);

    if ($i == $j) {
        $curl->cbTask = null;
    }
}
@ares333
Copy link
Owner

ares333 commented May 3, 2016

sleep是进程暂停,cbUser或回掉中写最合适。

@ares333 ares333 closed this as completed May 23, 2016
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

2 participants