Permalink
Browse files

Use queue-specific settings.

Signed-off-by: Chris Lamb <chris@thread.com>
  • Loading branch information...
1 parent f071a0b commit 810a5207d274f728e8fa263217f9341066db174d @lamby lamby committed Jul 26, 2012
Showing with 7 additions and 4 deletions.
  1. +4 −0 django_lightweight_queue/app_settings.py
  2. +3 −4 django_lightweight_queue/backends/redis.py
@@ -7,3 +7,7 @@ def setting(suffix, default):
MIDDLEWARE = setting('MIDDLEWARE', (
'django_lightweight_queue.middleware.logging.LoggingMiddleware',
))
+
+# Backend-specific settings
+REDIS_HOST = setting('REDIS_HOST', '127.0.0.1')
+REDIS_PORT = setting('REDIS_PORT', 6379)
@@ -2,17 +2,16 @@
import redis
-from django.conf import settings
-
from ..job import Job
+from .. import app_settings
class RedisBackend(object):
KEY = 'django_lightweight_queue'
def __init__(self):
self.client = redis.Redis(
- host=settings.REDIS_FEEDS_HOST,
- port=settings.REDIS_FEEDS_PORT,
+ host=app_settings.REDIS_HOST,
+ port=app_settings.REDIS_PORT,
)
def enqueue(self, job):

0 comments on commit 810a520

Please sign in to comment.