This commit is contained in:
slice 2018-06-16 17:00:08 -07:00
parent 8406188f5b
commit 6350ff688c
No known key found for this signature in database
GPG Key ID: 1508C19D7436A26D
1 changed files with 2 additions and 5 deletions

7
run.py
View File

@ -19,20 +19,17 @@ app = make_app()
@app.before_serving
async def create_db_pool():
"""Startup tasks for app"""
async def app_before_serving():
log.info('opening db')
app.db_pool = await asyncpg.create_pool(**app.config['POSTGRES'])
@app.after_serving
async def close_db_pool():
"""Close the DB connection."""
async def app_after_serving():
log.info('closing db')
await app.db_pool.close()
@app.route('/')
async def index():
"""Base handler for /."""
return 'hai'