auto_backup
auto_backup copied to clipboard
Close sftp connection when an exception happens
When an exception happens, this addon leaves SFTP connection openned. And the next time that a backup is executed, it won't be able to put it into the SFTP server because there is an older SFTP connection openned. So we added in db_backup.py, a finally block to the general try - except that verifies if sftp object exists, then close sftp connection. Kind regards
Our new Pull request Closes SFTP connections openned with vars sftp and s , even when an exception happens.
The method from https://github.com/Yenthe666/auto_backup/commit/4fb7846cbf2a378795fb29b5903abee31071ec67 looks way cleaner honestly