Skip to content

Commit

Permalink
Allow to set the redis DB to use
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Valsecchi committed Aug 19, 2019
1 parent ac0b0fa commit 3656e3c
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ MEMCACHED_HOST=memcached
MEMCACHED_PORT=11211
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_DB=0
TILEGENERATION_SQS_QUEUE=<queue_name>
TILEGENERATION_S3_BUCKET=<bucket_name>
GUNICORN_PARAMS=--bind=:8080 --worker-class=gthread --threads=10 --workers=5 --timeout=60 --max-requests=1000 --max-requests-jitter=100
# Use the mutualised print, ask Camptocamp to configure your project.
PRINT_URL=https://mutualized-print.paas-ch-3.camptocamp.com/print/${mutualized_print_app}/
DEVSERVER_HOST=webpack_dev_server:8080
C2C_REDIS_URL=redis://redis:6379
C2C_REDIS_URL=redis://redis:6379/0
PGOPTIONS=-c statement_timeout=30000
CATALINA_OPTS=-Xmx1024m
C2C_BROADCAST_PREFIX=broadcast_geoportal_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ services:
- MEMCACHED_PORT
- REDIS_HOST
- REDIS_PORT
- REDIS_DB
- TILEGENERATION_SQS_QUEUE
- TILEGENERATION_S3_BUCKET
- AWS_ACCESS_KEY_ID
Expand Down Expand Up @@ -166,6 +167,7 @@ services:
- DEVSERVER_HOST
- REDIS_HOST
- REDIS_PORT
- REDIS_DB
- C2C_REDIS_URL
- PGOPTIONS
- C2C_BROADCAST_PREFIX_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ generation:
maxconsecutive_errors: 10

redis:
url: 'redis://${REDIS_HOST}:${REDIS_PORT}'
url: 'redis://${REDIS_HOST}:${REDIS_PORT}/${REDIS_DB}'

# Not used if the previous redis section is not commented out
sqs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ vars:
memcached_host: '{MEMCACHED_HOST}'
memcached_port: '{MEMCACHED_PORT}'
tilegeneration_sqs_queue: '{TILEGENERATION_SQS_QUEUE}'
tilegeneration_redis: 'redis://{REDIS_HOST}:{REDIS_PORT}'
tilegeneration_redis: 'redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_DB}'
tiles_s3_bucket: '{TILEGENERATION_S3_BUCKET}'

runtime_environment:
Expand All @@ -62,6 +62,7 @@ runtime_environment:
- DEVSERVER_HOST
- REDIS_HOST
- REDIS_PORT
- REDIS_DB
- MEMCACHED_HOST
- MEMCACHED_PORT
- TILEGENERATION_SQS_QUEUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ vars:
memcached_host: '{MEMCACHED_HOST}'
memcached_port: '{MEMCACHED_PORT}'
tilegeneration_sqs_queue: '{TILEGENERATION_SQS_QUEUE}'
tilegeneration_redis: 'redis://{REDIS_HOST}:{REDIS_PORT}'
tilegeneration_redis: 'redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_DB}'

# mapserver connexion string
mapserver_connection: user={dbuser} password={dbpassword} dbname={db} host={dbhost}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ to-tmpl: $(ALL_TMPL_MAKO_FILES:.mako=)
sed -e 's#/\$${instanceid}/#${entry_point}#g' -i $<
c2c-template --vars vars_convert2tmpl.yaml --engine mako \
--runtime-environment-pattern '$${{{}}}' --files $<
rm $<
git rm $<
git add $@
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ vars:
arguments:
host: '{REDIS_HOST}'
port: '{REDIS_PORT}'
db: '{REDIS_DB}'
lock_timeout: 120 # Two minutes
redis_expiration_time: 86400 # One day
distributed_lock: True
Expand Down Expand Up @@ -882,6 +883,8 @@ runtime_environment:
default: redis
- name: REDIS_PORT
default: '6372'
- name: REDIS_DB
default: '0'
- name: MEMCACHED_HOST
default: memcached
- name: MEMCACHED_PORT
Expand Down

0 comments on commit 3656e3c

Please sign in to comment.