下发完成后,关闭ftp连接
This commit is contained in:
@@ -78,6 +78,13 @@ class FtpController:
|
||||
with open(localpath, mode='rb') as file:
|
||||
self.ftp.storbinary('STOR ' + remotepath, file, bufsize)
|
||||
|
||||
# 关闭连接
|
||||
def close_ftp(self):
|
||||
"""
|
||||
下发完成后关闭ftp连接,减少资源损耗
|
||||
"""
|
||||
self.ftp.close()
|
||||
|
||||
|
||||
def delAllfile(self, ftppath):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user