diff --git a/riakcached/client.py b/riakcached/client.py index 040813b..49479e1 100644 --- a/riakcached/client.py +++ b/riakcached/client.py @@ -21,13 +21,12 @@ class RiakClient(object): "url", ] - def __init__(self, bucket, url="http://127.0.0.1:8098", timeout=2): + def __init__(self, bucket, url="http://127.0.0.1:8098", timeout=2, auto_connect=True): """ """ self.bucket = bucket self.url = url.strip("/") self._timeout = timeout - self._connect() self._serializers = { "application/json": json.dumps, } @@ -35,6 +34,9 @@ class RiakClient(object): "application/json": json.loads, } + if auto_connect: + self._connect() + def setup_serializer(self, content_type, serializer, deserializer): """ """