fix(sftp): infinite loop while remove file (close #1094)
This commit is contained in:
parent
62aefc4f68
commit
323dad2a1c
@ -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 {
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user