diff --git a/README.md b/README.md index 9feddc99..39a9d9c7 100644 --- a/README.md +++ b/README.md @@ -354,6 +354,7 @@ The export server can also be used as a node module to simplify integrations: * `initialWorkers` (default 5) - initial worker process count * `workLimit` (default 50) - how many task can be performed by a worker process before it's automatically restarted * `queueSize` (default 5) - how many request can be stored in overflow count when there are not enough workers to handle all requests + * `timeoutThreshold` (default 3500) - the maximum allowed time for each export job execution, in milliseconds. If a worker has been executing a job for longer than this period, it will be restarted * `killPool()`: kill the phantom processes ## Using Ajax in Injected Resources diff --git a/lib/phantompool.js b/lib/phantompool.js index b7ed24d3..8657a3c9 100644 --- a/lib/phantompool.js +++ b/lib/phantompool.js @@ -296,7 +296,7 @@ function init(config) { settings = { queueSize: config.queueSize || 5, - timeoutThreshold: 3500, + timeoutThreshold: config.timeoutThreshold || 3500, maxWorkers: config.maxWorkers || 8, initialWorkers: config.initialWorkers || config.maxWorkers || 8, worker: config.worker || __dirname + '/../phantom/worker.js',