diff gpp/accounts/management/commands/rate_limit_clear.py @ 508:6f5fff924877

Created a centralized spot to get a Redis connection so that settings can be managed in one place.
author Brian Neal <bgneal@gmail.com>
date Sun, 04 Dec 2011 19:53:27 +0000
parents 09a9402e4a71
children
line wrap: on
line diff
--- a/gpp/accounts/management/commands/rate_limit_clear.py	Sun Dec 04 03:05:21 2011 +0000
+++ b/gpp/accounts/management/commands/rate_limit_clear.py	Sun Dec 04 19:53:27 2011 +0000
@@ -9,6 +9,9 @@
 from django.core.management.base import BaseCommand
 import redis
 
+from core.services import get_redis_connection
+
+
 IP_RE = re.compile(r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$')
 
 
@@ -21,7 +24,7 @@
 
     def handle(self, *args, **kwargs):
         try:
-            con = redis.Redis()
+            con = get_redis_connection()
 
             # get all rate-limit keys
             keys = con.keys('rate-limit-*')