Commit bce61f05 authored by Vincent Pelletier's avatar Vincent Pelletier

Stop closing connections explicitly.

Garbage-collecting memcache.Client instance does that automatically.
parent 16274e10
...@@ -94,22 +94,12 @@ if memcache is not None: ...@@ -94,22 +94,12 @@ if memcache is not None:
self._initialiseConnection() self._initialiseConnection()
def _initialiseConnection(self): def _initialiseConnection(self):
try:
self.memcached_connection.disconnect_all()
except AttributeError:
pass
self.memcached_connection = memcache.Client( self.memcached_connection = memcache.Client(
self.server_list, self.server_list,
server_max_key_length=self.server_max_key_length, server_max_key_length=self.server_max_key_length,
server_max_value_length=self.server_max_value_length, server_max_value_length=self.server_max_value_length,
) )
def __del__(self):
"""
Close connection before deleting object.
"""
self.memcached_connection.disconnect_all()
def _finish(self, *ignored): def _finish(self, *ignored):
""" """
Actually modifies the values in memcached. Actually modifies the values in memcached.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment