Skip to content

Commit

Permalink
fix: flaskr data dir reference when config not available
Browse files Browse the repository at this point in the history
  • Loading branch information
ivelin committed Nov 4, 2019
1 parent e0212ba commit 8f8139d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ ambianic/webapp/bower_components/paper/
**/coverage.xml
**/.__*
_mdwriter.cson
**/timeline-event-log.yaml
7 changes: 6 additions & 1 deletion src/ambianic/webapp/flaskr.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@

# configuration
DEBUG = True
DEFAULT_DATA_DIR = './data'


class FlaskJob(ManagedService):

def __init__(self, config):
self.config = config
data_dir = config.get('data_dir', './data')
data_dir = None
if config:
data_dir = config.get('data_dir', None)
if not data_dir:
data_dir = DEFAULT_DATA_DIR
self.srv = None
app = create_app(data_dir=data_dir)
self.srv = make_server('0.0.0.0', 8778, app)
Expand Down

0 comments on commit 8f8139d

Please sign in to comment.