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

Timeouts #34

Open
jlaustill opened this issue Jun 26, 2017 · 0 comments
Open

Timeouts #34

jlaustill opened this issue Jun 26, 2017 · 0 comments

Comments

@jlaustill
Copy link

First off, this library is great so thanks for making it!

I just wrote a quick set of tests to validate our site, but we have a few pages that always take longer than 2 seconds to load(magento, yuck). anyways, I don't see any way to define a longer timeout. So I dug into your code and found it to be as easy as

var getRequest = function(isLocal, options) {
    var timeout = options.timeout || 2000;
	var req = isLocal ? proxyRequest.post(w3cCheckUrl) : proxyRequest.get(w3cCheckUrl).timeout({response: timeout, deadline: timeout * 30});

and then passing in

        w3cjs.validate({
        file: environment.server + '/apparel/',
	timeout: 20000,

Is this something you would be willing to accept a PR for? If so, how would you go about implementing it? This works and keeps the default basically the same as the defaults for the request library. I don't find the 'response' and 'deadline' verbage useful or meaningful at all, so I just used timeout and computed it to match the defaults. I'd be happy to handle it a better way however :)

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

1 participant