Browse Source

Flask packages using redis are all namespaced and use the cache in development versions

develop
Sam Black 5 years ago
parent
commit
9d4385cfc5
  1. 2
      deployment/sponson/rq_settings.conf
  2. 2
      deployment/vagrant/rq_settings.conf
  3. 8
      vowel/config.py
  4. 8
      vowel/web.py

2
deployment/sponson/rq_settings.conf

@ -6,5 +6,5 @@
# copy it to the instance directory
# and edit it there.
RQ_REDIS_URL="redis://redis.sponson.lan:6379/8"
RQ_REDIS_URL="redis://redis.sponson.lan:6379/1"
SENTRY_DSN=""

2
deployment/vagrant/rq_settings.conf

@ -6,5 +6,5 @@
# copy it to the instance directory
# and edit it there.
RQ_REDIS_URL="redis://localhost:6379/2"
RQ_REDIS_URL="redis://localhost:6379/1"
SENTRY_DSN=""

8
vowel/config.py

@ -31,15 +31,17 @@ DATASTORE_PATH = "/media/vowel_datastore"
MAX_CONTENT_LENGTH = 128 * 1024 * 1024
REDIS_URI = "redis://localhost/"
CACHE_REDIS_URL = "{}5".format(REDIS_URI)
REDIS_DEFAULT_URI = "{}1".format(REDIS_URI)
CACHE_TYPE = "redis"
CACHE_REDIS_URI = REDIS_DEFAULT_URI
CACHE_DEFAULT_TIMEOUT = 300
RQ_DEFAULT_URL = "{}2".format(REDIS_URI)
RQ_DEFAULT_URL = REDIS_DEFAULT_URI
RQ_HIGH_URL = RQ_DEFAULT_URL
RQ_LOW_URL = RQ_DEFAULT_URL
SOCKETIO_REDIS_URL = "{}3".format(REDIS_URI)
SOCKETIO_REDIS_URL = REDIS_DEFAULT_URI
MAIL_SERVER = "localhost"
MAIL_PORT = 25

8
vowel/web.py

@ -142,21 +142,13 @@ def setup_infrastructure(app):
assets.append_path(asset_path)
assets.cache = asset_cache_path
assets.debug = app.config["DEBUG"]
# Don't rebuild the files if this is a production server.
assets.auto_build = app.config["DEBUG"]
assets.from_module(vowel_assets)
Gravatar(app, size=160)
# Turn off caching in debug mode
if app.config["DEBUG"]:
app.config["CACHE_TYPE"] = "null"
app.config["CACHE_NO_NULL_WARNING"] = True
cache.init_app(app)
# There maybe cached items that need to be flushed
with app.app_context():
cache.clear()

Loading…
Cancel
Save