thomasdondorf / puppeteer-cluster

Puppeteer Pool, run a cluster of instances in parallel
MIT License
3.22k stars 309 forks source link

I think a timeout of `0` should disable timeouts #511

Open stoddabr opened 1 year ago

stoddabr commented 1 year ago

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 commented 1 year ago

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

tamusjroyce commented 1 year ago

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

RubberArchind commented 1 month ago

yea that would be great to have