Closed khandelwal closed 9 years ago
I think we might be able to work around this issue by duplicating the app in the yaml file. The first only deploys one instance while updating the data and the second can deploy multiple instances, but doesn't update the database.
manifest file
---
# all applications use these settings and services
memory: 1G
instances: 1
applications:
- name: openfoia-staging
path: .
timeout: 180
command: echo '---loading data---' & bash cf.sh
- name: openfoia-staging
instances: 2
path: .
timeout: 180
command: echo '---deploying---' & waitress-serve --port=$VCAP_APP_PORT foia_hub.wsgi:application
We solved a similar problem on FEC by using the CF_INSTANCE_INDEX https://github.com/18F/openFEC/blob/master/run_api.py
@arowla This is great, thanks!
:heart: @arowla for jumping in and showing us how it's done. We're using your solution.
Glad y'all appreciated the drive-by. :car:
Solved with 18F/foia-hub/pull/742
if we're starting more than one instance, we need to only have one of those instances do data loading and database changes.