try out redis

This commit is contained in:
2021-03-07 19:22:48 +01:00
parent 7039489838
commit bb6d2ad8de
+6 -4
View File
@@ -35,12 +35,14 @@ def create_app(test_config=None):
app = Flask(__name__, instance_relative_config=True) app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping( app.config.from_mapping(
SECRET_KEY='dev', SECRET_KEY='dev',
DEBUG=True, # some Flask specific configs
CACHE_TYPE="SimpleCache", # Flask-Caching related configs
CACHE_DEFAULT_TIMEOUT=30
) )
CORS(app) CORS(app)
cache.init_app(app, config={'CACHE_TYPE': 'SimpleCache', 'CACHE_DEFAULT_TIMEOUT': 30}) cache.init_app(app, config={
'CACHE_TYPE': 'RedisCache',
'CACHE_DEFAULT_TIMEOUT': 30,
'CACHE_KEY_PREFIX': 'agora',
'CACHE_REDIS_HOST': 'localhost',
})
if test_config is None: if test_config is None:
# load the instance config, if it exists, when not testing # load the instance config, if it exists, when not testing