Exemplo n.º 1
0
 def __init__(self, **options):
     if not options:
         # inherit default options from REDIS_OPTIONS
         options = settings.SENTRY_REDIS_OPTIONS
     super(RedisQuota, self).__init__(**options)
     options.setdefault('hosts', {0: {}})
     self.cluster = Cluster(options['hosts'])
Exemplo n.º 2
0
    def __init__(self, **options):
        if not options:
            # inherit default options from REDIS_OPTIONS
            options = settings.SENTRY_REDIS_OPTIONS

        options.setdefault('hosts', {
            0: {},
        })
        self.cluster = Cluster(options['hosts'])
        self.client = self.cluster.get_routing_client()
Exemplo n.º 3
0
    def __init__(self, hosts=None, prefix='ts:', vnodes=64, **kwargs):
        # inherit default options from REDIS_OPTIONS
        defaults = settings.SENTRY_REDIS_OPTIONS

        if hosts is None:
            hosts = defaults.get('hosts', {0: {}})

        self.cluster = Cluster(hosts)
        self.prefix = prefix
        self.vnodes = vnodes
        super(RedisTSDB, self).__init__(**kwargs)
Exemplo n.º 4
0
def test_redis_blaster_operation_disable_instance():
    from rb import Cluster

    cluster = Cluster(hosts={0: {
        'port': DB_SETTINGS['port']
    }},
                      host_defaults={'host': DB_SETTINGS['host']})
    exercise_fanout(cluster)

    client = cluster.get_routing_client()
    exercise_redis(client)
Exemplo n.º 5
0
    def __init__(self, version=None, prefix=None, **options):
        if not options:
            # inherit default options from REDIS_OPTIONS
            options = settings.SENTRY_REDIS_OPTIONS

        options.setdefault('hosts', {
            0: {},
        })
        self.cluster = Cluster(options['hosts'])
        self.client = self.cluster.get_routing_client()

        super(RedisCache, self).__init__(version=version, prefix=prefix)
Exemplo n.º 6
0
def init_redis_cache():
    global cluster
    cluster = Cluster(hosts=redis_map.nodes,
                      host_defaults=redis_map.node_options,
                      router_cls=KemonoRouter)
    return cluster