fix(sftp): infinite loop while remove file (close #1094)

This commit is contained in:
Noah Hsu 2022-05-28 21:01:04 +08:00
parent 62aefc4f68
commit 323dad2a1c
2 changed files with 2 additions and 2 deletions

View File

@ -195,7 +195,7 @@ func (driver SFTP) Delete(path string, account *model.Account) error {
if err != nil { if err != nil {
return err return err
} }
return client.Remove(utils.Join(account.RootFolder, path)) return client.remove(utils.Join(account.RootFolder, path))
} }
func (driver SFTP) Upload(file *model.FileStream, account *model.Account) error { func (driver SFTP) Upload(file *model.FileStream, account *model.Account) error {

View File

@ -49,7 +49,7 @@ func (client *Client) Files(remotePath string) ([]os.FileInfo, error) {
return client.ReadDir(remotePath) return client.ReadDir(remotePath)
} }
func (client *Client) Remove(remotePath string) error { func (client *Client) remove(remotePath string) error {
f, err := client.Stat(remotePath) f, err := client.Stat(remotePath)
if err != nil { if err != nil {
return nil return nil