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

FTP: isConnected does not recognize timed out FTP connection #536

Open
moritzwachter opened this issue Nov 1, 2017 · 0 comments
Open

FTP: isConnected does not recognize timed out FTP connection #536

moritzwachter opened this issue Nov 1, 2017 · 0 comments
Assignees

Comments

@moritzwachter
Copy link

I had the issue while using the Ftp-Adapter with Sonata's Notification Queue.

Basically the Notification listener is running for some hours before a new Event is triggered and the service which uses the KnpGaufretteBundle is executed. As the service is a singleton there is no new initialisation of the Ftp connection.
So in the meantime the Ftp connection timed out but isConnected still returns true.

My workaround was to change the function as follows:
Before:

private function isConnected()
{
    return is_resource($this->connection);
}

After:

private function isConnected()
{
    return is_array(ftp_nlist($this->connection, '.'));
}

Do you think this 'workaround' makes sense to be adapted to the official FtpAdapter? I am happy to provide a PR if needed.

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

3 participants