When psycopg2.errors.AdminShutdown/sqlalchemy.exc.OperationalError (or similar!) exception is thrown, take down the whole bot and try again (either with docker or systemd service).
When sqlalchemy.exc.InvalidRequestError is thrown, try to reset the session and roll back, so every new interaction doesn't cause messages to be thrown.
When
psycopg2.errors.AdminShutdown/sqlalchemy.exc.OperationalError(or similar!) exception is thrown, take down the whole bot and try again (either with docker or systemd service).When
sqlalchemy.exc.InvalidRequestErroris thrown, try to reset the session and roll back, so every new interaction doesn't cause messages to be thrown.