Updated the disconnect() method to wait until the connection has been… #9911
Pull Request check-list
Please make sure to review and check all of these items:
Description of change
We're using sequelize on AWS lambda with the postgres dialect and the script execution is halted before the connection is closed which causes weird issues with database connections. This change ensures that the connection is properly closed before the execution ends.
Helps with #8468.