Skip to content

'Redis' object has no attribute 'disconnect' #149

Closed
@kirberich

Description

@kirberich

Hi!

I just started using CacheControl with redis in a project, and while the caching itself works great, I'm running into problems when CacheControl tries to disconnect from redis, where it's calling a disconnect method on the redis object that doesn't exist.

I haven't been able to dig much deeper into this yet, some pointers would be much appreciated! I'll try to find out more about this tomorrow.

.virtualenv/lib/python3.6/site-packages/requests/sessions.py:369: in __exit__
    self.close()
.virtualenv/lib/python3.6/site-packages/requests/sessions.py:690: in close
    v.close()
.virtualenv/lib/python3.6/site-packages/cachecontrol/adapter.py:129: in close
    self.cache.close()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <cachecontrol.caches.redis_cache.RedisCache object at 0x10f6f60f0>

    def close(self):
>       self.conn.disconnect()
E       AttributeError: 'Redis' object has no attribute 'disconnect'

.virtualenv/lib/python3.6/site-packages/cachecontrol/caches/redis_cache.py:41: AttributeError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions