Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def connect(self, server):
server = CacheMemcacheStrategy.splitHosts(server)
assert server, "{} is not a suitable server".format(server)
if len(server) == 1:
clientClass = Client
server = server[0]
else:
from pymemcache.client.hash import HashClient
clientClass = HashClient
self.client = clientClass(server, ignore_exc=True,
serializer=python_memcache_serializer,
deserializer=python_memcache_deserializer,
timeout=5,
connect_timeout=5,
key_prefix=(getStringHash(self.fileStrategy.dir) + "_").encode("UTF-8")
)
def __init__(self, servers, *args, **kwargs):
kwargs['serializer'] = python_memcache_serializer
kwargs['deserializer'] = python_memcache_deserializer
return super(Client, self).__init__(
_split_host_and_port(servers), *args, **kwargs)