From 5cd24e5477b2b0797111d785bc7598504b8f7a52 Mon Sep 17 00:00:00 2001 From: Rob Landers Date: Wed, 11 Nov 2015 23:02:41 -0500 Subject: [PATCH] Don't run out of connections when using persistent connections --- src/object-cache.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/object-cache.php b/src/object-cache.php index d4e15e0..92702b7 100644 --- a/src/object-cache.php +++ b/src/object-cache.php @@ -839,7 +839,10 @@ public function __construct( $persistent_id = NULL ) { $this->servers = empty( $memcached_servers ) ? array( array( '127.0.0.1', 11211 ) ) : $memcached_servers; - $this->addServers( $this->servers ); + # If we are using persistent connection, we don't want to keep adding the same servers to the client + if (empty($this->m->getServerList())) { + $this->addServers( $this->servers ); + } /** * This approach is borrowed from Sivel and Boren. Use the salt for easy cache invalidation and for