Closed MadhuVK closed 1 year ago
It looks like this may have been the existing behavior until the following recent commit: https://github.com/timgit/pg-boss/commit/2a684185161eade58791c0f568c57d513de86df7
I can see why this is useful, but I think it may also make sense to expose a db shutdown option as a one of the StopOptions
.
I agree that an option should be provided in stop()
to control the closing of the pool
Hey there! Really grateful that you created and are continuing to support this lib.
I noticed that
PgBoss.stop
does not seem to close thepg.Pool
instance, even when using the internal construction (i.e. not BYODB). I believe any socket handles will eventually be cleaned up, but it does create some noise in our tests which report "leaked handles."Furthermore, it also creates slowdown when shutting down our application as we need to wait for the pool resources to automatically clean up on the pool's idle timeout.
I was playing around, and it looks like the following addition alleviated the problem for me:
Let me know if you would be open to including something like this - I'm unclear if there are other ramifications here to graceful shutdown.