Update more Redis URLs

This commit is contained in:
Mark Veidemanis 2025-01-23 11:34:24 +00:00
parent 6ff75890b9
commit fe087eb591
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
2 changed files with 16 additions and 13 deletions

View File

@ -6,13 +6,15 @@ from redis import StrictRedis
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true" os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
# /var/run/neptune-redis.sock
r = StrictRedis( # use the socket
host=settings.REDIS_HOST, r = StrictRedis(unix_socket_path="/var/run/neptune-redis.sock", db=settings.REDIS_DB)
port=settings.REDIS_PORT, # r = StrictRedis(
password=settings.REDIS_PASSWORD, # host=settings.REDIS_HOST,
db=settings.REDIS_DB # port=settings.REDIS_PORT,
) # password=settings.REDIS_PASSWORD,
# db=settings.REDIS_DB
# )
if settings.STRIPE_TEST: if settings.STRIPE_TEST:
stripe.api_key = settings.STRIPE_API_KEY_TEST stripe.api_key = settings.STRIPE_API_KEY_TEST

View File

@ -94,12 +94,13 @@ def process_rules(data):
class Command(BaseCommand): class Command(BaseCommand):
def handle(self, *args, **options): def handle(self, *args, **options):
r = StrictRedis( r = StrictRedis(unix_socket_path="/var/run/neptune-redis.sock", db=10) # To match Monolith DB
host=settings.REDIS_HOST, # r = StrictRedis(
port=settings.REDIS_PORT, # host=settings.REDIS_HOST,
password=settings.REDIS_PASSWORD, # port=settings.REDIS_PORT,
db=settings.REDIS_DB # password=settings.REDIS_PASSWORD,
) # db=settings.REDIS_DB
# )
p = r.pubsub() p = r.pubsub()
p.psubscribe("messages") p.psubscribe("messages")
for message in p.listen(): for message in p.listen():