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

资源计数有些问题 #8

Open
magicsilence opened this issue Mar 16, 2015 · 3 comments
Open

资源计数有些问题 #8

magicsilence opened this issue Mar 16, 2015 · 3 comments

Comments

@magicsilence
Copy link

phantomjs/index.js

    page.onResourceReceived = function(res){
        if(res.stage === 'end'){
            count--;
            // log('- [' + count + ']' + res.url, _.log.DEBUG);
            callback();
        }
    };

加上重定向的判断会好一些 : if(res.stage === 'end' || !!res.redirectURL)

@magicsilence
Copy link
Author

这样也不对。
重定向的请求,不能保证收到stage === 'end' 的事件.

@magicsilence
Copy link
Author

针对请求ID, 对不同响应码分别处理,会比计数更可靠

@fouber
Copy link
Owner

fouber commented Mar 16, 2015

@magicsilence

多谢提醒, 之前确实没有注意到,后面我改一下

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