mirror of https://gitlab.com/litecord/litecord.git
clean
This commit is contained in:
parent
8406188f5b
commit
6350ff688c
7
run.py
7
run.py
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Reference in New Issue