disqus / gutter

Fully featured Python feature switch toolkit
Apache License 2.0
226 stars 30 forks source link

Am I doing something wrong? #16

Closed ghost closed 10 years ago

ghost commented 10 years ago

As you can see it's not copy-pasted from the documentation but almost. durabledict.dict cannot be found etc. Let me know if this should work first and foremost.

I am running this

>>> from gutter.client.settings import manager as manager_settings
>>> from durabledict.redis import RedisDict
>>> from redis import Redis as RedisClient
>>>
>>> manager_settings.storage_engine = RedisDict('gutter', RedisClient())
>>> manager_settings.autocreate = True
>>> manager_settings.autocreate
True

Then I quit, and run the same thing again but this time just to check persistence:

>>> from gutter.client.settings import manager as manager_settings
>>> from durabledict.redis import RedisDict
>>> from redis import Redis as RedisClient
>>>
>>> manager_settings.storage_engine = RedisDict('gutter', RedisClient())
>>> manager_settings.autocreate
False

Shouldn't this return True?

Fluxx commented 10 years ago

This is expected behavior. The storage of a manager only stores the switches themselves, not the manager attributes or configuration. The manager's configuration is client-specific and shouldn't per persisted or shared between clients.