auto_backup icon indicating copy to clipboard operation
auto_backup copied to clipboard

Close sftp connection when an exception happens

Open bakatasolutionssl opened this issue 4 years ago • 2 comments

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

bakatasolutionssl avatar Jul 17 '20 11:07 bakatasolutionssl

Our new Pull request Closes SFTP connections openned with vars sftp and s , even when an exception happens.

bakatasolutionssl avatar Jul 21 '20 10:07 bakatasolutionssl

The method from https://github.com/Yenthe666/auto_backup/commit/4fb7846cbf2a378795fb29b5903abee31071ec67 looks way cleaner honestly

Yenthe666 avatar Jul 21 '20 10:07 Yenthe666