Skip to content

Commit 552f689

Browse files
committed
Allow customization of timeoutThreshold in phantompool.js - #171
1 parent 264d5db commit 552f689

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ The export server can also be used as a node module to simplify integrations:
354354
* `initialWorkers` (default 5) - initial worker process count
355355
* `workLimit` (default 50) - how many task can be performed by a worker process before it's automatically restarted
356356
* `queueSize` (default 5) - how many request can be stored in overflow count when there are not enough workers to handle all requests
357+
* `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
357358
* `killPool()`: kill the phantom processes
358359

359360
## Using Ajax in Injected Resources

lib/phantompool.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ function init(config) {
296296

297297
settings = {
298298
queueSize: config.queueSize || 5,
299-
timeoutThreshold: 3500,
299+
timeoutThreshold: config.timeoutThreshold || 3500,
300300
maxWorkers: config.maxWorkers || 8,
301301
initialWorkers: config.initialWorkers || config.maxWorkers || 8,
302302
worker: config.worker || __dirname + '/../phantom/worker.js',

0 commit comments

Comments
 (0)