[X] I searched existing issues before opening this one to avoid duplicates
[X] I understand this is not a place for seek help, but to report a bug
[X] I understand that the bug must be proven first with a minimal reproduction
[X] I will be polite, respectful, and considerate of people's time and effort
Minimal reproduction URL
No reproduction
Version
v0.0.0
Node.js version
v20
Package manager
pnpm
Operating system
Windows
Problem & Expected behavior
What happened?
No process.on('SIGINT') nor any other event is fired before the tsx watch mode recompiles the code
What did you expect instead?
I expect to be able to get an event on watch mode (when saving a file) to close dependencies and disconnect from my database with prisma.$disconnect() to avoid getting this error: "[FATAL: sorry, too many clients already]". Since the watch mode doesn't fire any event, connections keep piling up and there's no disconnection made. Also, since it recompiles everything, it doesn't "save" the connection made and just keeps it idle.
Let me know if there is a possibility to get at least an event on the process to kill the connections that need to be killed.
Thanks.
Contributions
[ ] I plan to open a pull request for this issue
[ ] I plan to make a financial contribution to this project
Acknowledgements
Minimal reproduction URL
No reproduction
Version
v0.0.0
Node.js version
v20
Package manager
pnpm
Operating system
Windows
Problem & Expected behavior
What happened? No
process.on('SIGINT')
nor any other event is fired before the tsx watch mode recompiles the codeWhat did you expect instead? I expect to be able to get an event on watch mode (when saving a file) to close dependencies and disconnect from my database with prisma.$disconnect() to avoid getting this error: "[FATAL: sorry, too many clients already]". Since the watch mode doesn't fire any event, connections keep piling up and there's no disconnection made. Also, since it recompiles everything, it doesn't "save" the connection made and just keeps it idle.
Let me know if there is a possibility to get at least an event on the process to kill the connections that need to be killed.
Thanks.
Contributions