thomasdondorf/puppeteer-cluster

Cluster.queue() await doesn't work

4e576rt8uh9ij9okp opened this issue · 0 comments

Hi there,
I have an issue, I want to wait for the queue and tested it with await and I wanted to log the result but it logs before the await.

    let result = await cluster.queue('https://www.cpu-monkey.com/de/cpu_benchmark-cinebench_2024_single_core', doSomething)
    console.log(result)

the function is a async function with a return. The function has many lines that's why I'm not posting it here, logging the return data like:

async function doSomething(){
    let data = await somethingThatReturnsText()
    console.log(data)
    return data
}

So what I want to do, is I want to merge the data and push it to a database.