mirror of https://github.com/Xhofe/alist
🐛 fix #462 check connect while get ftp client
parent
6fd05d7d72
commit
cb23edc1fe
|
@ -11,7 +11,12 @@ var connMap map[string]*ftp.ServerConn
|
|||
func (driver FTP) Login(account *model.Account) (*ftp.ServerConn, error) {
|
||||
conn, ok := connMap[account.Name]
|
||||
if ok {
|
||||
return conn, nil
|
||||
_, err := conn.CurrentDir()
|
||||
if err == nil {
|
||||
return conn, nil
|
||||
} else {
|
||||
delete(connMap, account.Name)
|
||||
}
|
||||
}
|
||||
conn, err := ftp.Connect(account.SiteUrl)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue