puppeteer-cluster icon indicating copy to clipboard operation
puppeteer-cluster copied to clipboard

I think a timeout of `0` should disable timeouts

Open stoddabr opened this issue 2 years ago • 3 comments

this would reflect's puppeteer's use of the timeout option where if 0 is passed the timeout is never triggered. This is useful for some long-running tasks.

Example usage:

    const c: Cluster<PdfTaskData, void> = await Cluster.launch({
      concurrency: Cluster.CONCURRENCY_PAGE,
      maxConcurrency: 1, 
      timeout: 0,
      puppeteerOptions: {
        headless: true,
        timeout: 0,
        args: ["--no-sandbox", "--disable-setuid-sandbox"],
      },
    });

with the example above, currently any task will fail. Desired behavior would be that timeouts will never trigger.

stoddabr avatar Feb 10 '23 20:02 stoddabr

I'm happy to open a PR if others also think this should be the case but want to hear if there are any differing opinions first

stoddabr avatar Feb 10 '23 20:02 stoddabr

That would be great. Smaller than zero, like -1 would disable it, won't it?

0 timeout not timing out is often used in testing

tamusjroyce avatar Feb 20 '23 22:02 tamusjroyce