Skip to content

Commit 2d97f29

Browse files
committed
Remove needless context
1 parent 5f23712 commit 2d97f29

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

run.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,19 @@ def main():
6060
if app.config.get('AUTHZ_ON') is not None:
6161
es.authorization_enabled = app.config['AUTHZ_ON']
6262

63-
with app.test_request_context():
64-
try:
65-
annotation.Annotation.create_all()
66-
document.Document.create_all()
67-
except elasticsearch.exceptions.RequestError as e:
68-
if e.error.startswith('MergeMappingException'):
69-
date = time.strftime('%Y-%m-%d')
70-
log.fatal("Elasticsearch index mapping is incorrect! Please "
71-
"reindex it. You can use reindex.py for this, e.g. "
72-
"python reindex.py --host {0} {1} {1}-{2}".format(
73-
es.host,
74-
es.index,
75-
date))
76-
raise
63+
try:
64+
annotation.Annotation.create_all()
65+
document.Document.create_all()
66+
except elasticsearch.exceptions.RequestError as e:
67+
if e.error.startswith('MergeMappingException'):
68+
date = time.strftime('%Y-%m-%d')
69+
log.fatal("Elasticsearch index mapping is incorrect! Please "
70+
"reindex it. You can use reindex.py for this, e.g. "
71+
"python reindex.py --host {0} {1} {1}-{2}".format(
72+
es.host,
73+
es.index,
74+
date))
75+
raise
7776

7877
@app.before_request
7978
def before_request():

0 commit comments

Comments
 (0)