Skip to content

Commit

Permalink
fix for frinyvonnick#85
Browse files Browse the repository at this point in the history
  • Loading branch information
increpare committed Sep 16, 2021
1 parent bbf8002 commit 03b8c87
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ module.exports = async function(options) {
puppeteerOptions: { ...puppeteerArgs, headless: true },
});

for (var i=0;i<content.length;i++){
content[i]["___INDEX___"]=i;
}

let buffers = []

await cluster.task(async ({ page, data: { content, output, selector } }) => {
const buffer = await makeScreenshot(page, { ...options, content, output, selector })
buffers.push(buffer);
buffers[content["___INDEX___"]]=buffer;
});

cluster.on('taskerror', (err, data) => {
Expand Down

0 comments on commit 03b8c87

Please sign in to comment.