Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cluster.queue() await doesn't work #541

Open
4e576rt8uh9ij9okp opened this issue May 17, 2024 · 0 comments
Open

Cluster.queue() await doesn't work #541

4e576rt8uh9ij9okp opened this issue May 17, 2024 · 0 comments

Comments

@4e576rt8uh9ij9okp
Copy link

4e576rt8uh9ij9okp commented May 17, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant