sftp: ignore errors when closing the connection pool

There is no need to report errors when draining the connection pool -
they are useless at this point.

See: https://forum.rclone.org/t/rclone-fails-to-close-unused-tcp-connections-due-to-use-of-closed-network-connection/46735
This commit is contained in:
Nick Craig-Wood 2024-07-09 23:40:32 +01:00
parent 27267547b9
commit 6e853c82d8

View file

@ -815,13 +815,13 @@ func (f *Fs) drainPool(ctx context.Context) (err error) {
if cErr := c.closed(); cErr == nil { if cErr := c.closed(); cErr == nil {
cErr = c.close() cErr = c.close()
if cErr != nil { if cErr != nil {
err = cErr fs.Debugf(f, "Ignoring error closing connection: %v", cErr)
} }
} }
f.pool[i] = nil f.pool[i] = nil
} }
f.pool = nil f.pool = nil
return err return nil
} }
// NewFs creates a new Fs object from the name and root. It connects to // NewFs creates a new Fs object from the name and root. It connects to