Skip to content
This repository has been archived by the owner on Dec 30, 2019. It is now read-only.

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

Open
ghost opened this issue Sep 26, 2019 · 0 comments
Open

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

ghost opened this issue Sep 26, 2019 · 0 comments
Labels

Comments

@ghost
Copy link

ghost commented Sep 26, 2019

The pool.end callback/promise should resolve after the last pool.query finishes but that doesn't happen:

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

result:

done
end
done

this negatively affects my code because I have callbacks on both query() and end() and the end() callback needs to assume all the query() callbacks have already been called so it can shutdown the script etc. I tried looking into a fix but was more involved across repos will need to look again

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

No branches or pull requests

1 participant