mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-08 09:08:11 +08:00
removed SQS and IronMQ brokers for now
Both brokers are not atomic and cause all kinds of problems during testing. Needs more time. Meanwhile I want to release the pluggable broker backend.
This commit is contained in:
@@ -8,7 +8,6 @@ from django.conf import settings
|
||||
|
||||
# external
|
||||
import os
|
||||
import redis
|
||||
|
||||
# optional
|
||||
try:
|
||||
@@ -38,14 +37,6 @@ class Conf(object):
|
||||
# Optional Authentication
|
||||
DISQUE_AUTH = conf.get('disque_auth', None)
|
||||
|
||||
# Amazon SQS broker
|
||||
SQS = conf.get('sqs', None)
|
||||
|
||||
# IronMQ broker
|
||||
IRONMQ = conf.get('ironmq', None)
|
||||
if IRONMQ and os.environ.get('IRONMQ_TOKEN'):
|
||||
IRONMQ['token'] = os.environ['IRONMQ_TOKEN']
|
||||
|
||||
# Name of the cluster or site. For when you run multiple sites on one redis server
|
||||
PREFIX = conf.get('name', 'default')
|
||||
|
||||
@@ -142,28 +133,6 @@ if not logger.handlers:
|
||||
logger.addHandler(handler)
|
||||
|
||||
|
||||
# Django-redis support
|
||||
if Conf.DJANGO_REDIS:
|
||||
try:
|
||||
import django_redis
|
||||
except ImportError:
|
||||
django_redis = None
|
||||
|
||||
|
||||
def get_redis_client():
|
||||
"""
|
||||
Returns a connection from redis-py or django-redis
|
||||
:return: a redis client
|
||||
"""
|
||||
if Conf.DJANGO_REDIS and django_redis:
|
||||
return django_redis.get_redis_connection(Conf.DJANGO_REDIS)
|
||||
return redis.StrictRedis(**Conf.REDIS)
|
||||
|
||||
|
||||
# redis client
|
||||
redis_client = get_redis_client()
|
||||
|
||||
|
||||
# get parent pid compatibility
|
||||
def get_ppid():
|
||||
if hasattr(os, 'getppid'):
|
||||
|
||||
Reference in New Issue
Block a user