fix(server): wait before closing pubsub database connection
- Add
drain
parameter todestroy
function to optionally await thedrain
event on the pubsub database client before callingend
. Otherwise you can close the connection before all messages have been delivered which causes errors. I've made it optional because thedrain
event is not emitted if no query was issued. I couldn't think of a way to automatically detect whether it should wait or not so I left it up to the consumer to specify. - Expose manager on
pubsweet-server
package root.