0

I was working on a redis caching implementation, There is some scenario where i need to flush the particular db, after flushing the db I'm unable to set and get from the redis. can any particular reason be there or any mistake in my approach ? I'm using this funtion to make the app ready and followed by my deletion approach.

redis_engine = redis.ConnectionPool.from_url(Config.REDIS_URL)
def create_app():
    app = Flask(__name__, instance_relative_config=True,template_folder='../templates')
    app.config.from_object(Config)
    global redis_client
    redis_client = redis.Redis(connection_pool=redis_engine)
    db = SQLAlchemy(app)
    mongodb = MongoEngine(app)
    CORS(app)
    return app

deletion function below:

def delete_all_keys(redis_client):
    redis_client.execute_command('FLUSHDB ASYNC')
    redis_client.execute_command('QUIT')
    return True

Let me know if some knows the reason, I already tried using flask_and_redis library and flask_redis library too

Surya R
  • 445
  • 2
  • 10
  • Why do you use `ASYNC` please? Have you tried without? Why do you `QUIT` the connection when it's still running please? – Mark Setchell May 12 '22 at 07:22
  • I tried with flushdb only, since i'm this issue. so then tried flushing db in async way and thought connection is not moved so tired quitting the connection using quit, but both didn't helped – Surya R May 12 '22 at 14:30

0 Answers0