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

pool.end() resolves before the last pool.query() #2163

Open
ghost opened this issue Apr 15, 2020 · 0 comments
Open

pool.end() resolves before the last pool.query() #2163

ghost opened this issue Apr 15, 2020 · 0 comments
Labels

Comments

@ghost
Copy link

ghost commented Apr 15, 2020

The pool.end callback/promise should resolve after the last pool.query resolves but instead it always resolves just before the last query:

pool.query(query).then(() => console.log('done'))
pool.query(query).then(() => console.log('done'))
pool.query(query).then(() => console.log('done'))
pool.end().then(() => console.log('end'))

result:

done
done
end
done

it needs to resolve after to signal that all query callbacks have run

another example of this occurring is in PR #2149 (comment)

I have not looked at solution again yet but maybe can sometime coming up, or anyone else feel free to fix

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

No branches or pull requests

1 participant