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