Skip to content

Clean up the list of clients by removing dead/invalid connections. #3

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danielrampanelli
Copy link

Make sure we get rid of invalid connections, so that we are able to avoid errors while trying to push updated data.

@coveralls
Copy link

coveralls commented Dec 2, 2016

Coverage Status

Coverage increased (+0.02%) to 46.229% when pulling 09e9bf7 on neuralquery:development into c1483b5 on RickySu:master.

$this->clients = array_values(array_filter($this->clients, function($client) {
return !empty($client->app) && !empty($client->conn);
}));

$index = array_search($client, $this->clients, true);
if($index == false){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If $client is the first element of $this->clients (means $this->clients[0]), the result of $index is 0.
Using strong type compare ($index === false) is better.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, that seems to be the cause all along. I've seen you have updated the master branch with this change, and everything seems to just run smoothly. Thanks!

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

Successfully merging this pull request may close these issues.

3 participants