Skip to content

Commit

Permalink
fix(sftp): infinite loop while remove file (close #1094)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed May 28, 2022
1 parent 62aefc4 commit 323dad2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/sftp/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (driver SFTP) Delete(path string, account *model.Account) error {
if err != nil {
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 {
Expand Down
2 changes: 1 addition & 1 deletion drivers/sftp/sftp.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (client *Client) Files(remotePath string) ([]os.FileInfo, error) {
return client.ReadDir(remotePath)
}

func (client *Client) Remove(remotePath string) error {
func (client *Client) remove(remotePath string) error {
f, err := client.Stat(remotePath)
if err != nil {
return nil
Expand Down

0 comments on commit 323dad2

Please sign in to comment.