cunla / fakeredis-py

Implementation of Redis in python without having a Redis server running. Fully compatible with using redis-py.

Home Page:https://fakeredis.moransoftware.ca/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing get_fake_connection

jlopespt opened this issue · comments

Got this error message:

from fakeredis import get_fake_connection
E ImportError: cannot import name 'get_fake_connection' from 'fakeredis' (/usr/local/lib/python3.9/site-packages/fakeredis/init.py)

Noticed that this function was removed from the repository (commit 888adc0).

Was this intentional?
What is the alternative to it?

Many thanks for any feedback!

Hi,

I realized I needed to maintain this method whenever there were changes in django-rq, and I wanted to avoid it.
I still listed it in the documentation here. You can maintain this as part of your code (for me personally, I wanted the option of using UNIX_SOCKET_PATH instead of URL).

It would be great if django-rq would have a redis_cls parameters.

Alternatively, if you don't want to maintain the logic for the override method, you can override redis.Redis and redis.StrictRedis before calling django-rq.

@jlopespt did you manage? can this be closed?

Hi @cunla yes, we adapted our code.
Thanks for the feedback and follow up!