Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to close SFTP connection on demand #1757

Open
hasfoug opened this issue Feb 17, 2024 · 0 comments
Open

Ability to close SFTP connection on demand #1757

hasfoug opened this issue Feb 17, 2024 · 0 comments

Comments

@hasfoug
Copy link

hasfoug commented Feb 17, 2024

Feature Request

Add ability to close SFTP connection manually

Q A
Flysystem Version 3.24.0
Adapter Name league/flysystem-sftp-v3
Adapter version 3.23.1

Scenario / Use-case

I have a set of ~20 daily jobs that connect to SFTP server and upload files there (a single file per job). Now, since this is all managed by Laravel horizon, the connection is not being closed after file upload is done and since server has limit for connections it ends up not allowing last jobs in the queue to upload their files. This happens because jobs that already uploaded their files and finished successfully have not closed their connection (disconnect function is being called in __destruct method of SSH2 class which is never being called in this case). So, i just need to close connection manually after a file is successfully uploaded.

Summary

Pls provide a way to disconnect from SFTP server on demand by either:

  • adding a disconnect function on SftpAdapter class
  • OR adding getConnectionProvider() method to SftpAdapter class and getConnection() method to SftpConnectionProvider class so that disconnect method can be called from there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant