Javascript 限制产生的无头镀铬工艺的数量
我一直在使用Javascript 限制产生的无头镀铬工艺的数量,javascript,google-chrome,google-chrome-headless,Javascript,Google Chrome,Google Chrome Headless,我一直在使用chrome launcher和chrome remote interface从JS呈现的页面生成静态图像,如下所示: chromeLauncher.launch({ chromeFlags: [ '--window-size=1020,720', '--disable-gpu', '--headless' ] }).then(async function({port}) { const client = awa
chrome launcher
和chrome remote interface
从JS呈现的页面生成静态图像,如下所示:
chromeLauncher.launch({
chromeFlags: [
'--window-size=1020,720',
'--disable-gpu',
'--headless'
]
}).then(async function({port}) {
const client = await CDP({port})
...
})
它工作得很好,但这是对传入http请求的响应,我不想产生无限的色度。我如何才能最好地跟踪和限制生成的进程数,记住这是一个每次都重新运行的独立节点脚本