~sirn/fanboi2

ref: baf63a21556905a6c27516a8d5641d31120d1fe3 fanboi2/fanboi2/redis.py -rw-r--r-- 322 bytes
baf63a21Kridsada Thanabulpong Add scope column to banwords. 1 year, 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
from redis import StrictRedis


def includeme(config):  # pragma: no cache
    redis_url = config.registry.settings["redis.url"]
    redis_conn = StrictRedis.from_url(redis_url)

    def redis_conn_factory(context, request):
        return redis_conn

    config.register_service_factory(redis_conn_factory, name="redis")