Connecting to REDIS - alphagov/notifications-manuals GitHub Wiki
Sometimes it might be necessary to connect to REDIS via cli to troubleshoot.
Connecting to redis involves the following steps:
- Go 'inside' the admin ecs container (please see Running commands inside ECS containers)
- Type the following commands
flask shell
from app.extensions import redis_client
(optional) To check if redis has connected successfully you can use the command
redis_client.redis_store.ping()
(if you get a 'True', then it is ok to continue)
You can then use any redis-cli commands listed in this link https://redis-py.readthedocs.io/en/latest/commands.html. For example:
redis_client.redis_store.keys("*")
redis_client.redis_store.get("your-key-name")
redis_client.redis_store.delete("your-key-name)