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
|
@app.before_serving
|
||||||
async def create_db_pool():
|
async def app_before_serving():
|
||||||
"""Startup tasks for app"""
|
|
||||||
log.info('opening db')
|
log.info('opening db')
|
||||||
app.db_pool = await asyncpg.create_pool(**app.config['POSTGRES'])
|
app.db_pool = await asyncpg.create_pool(**app.config['POSTGRES'])
|
||||||
|
|
||||||
|
|
||||||
@app.after_serving
|
@app.after_serving
|
||||||
async def close_db_pool():
|
async def app_after_serving():
|
||||||
"""Close the DB connection."""
|
|
||||||
log.info('closing db')
|
log.info('closing db')
|
||||||
await app.db_pool.close()
|
await app.db_pool.close()
|
||||||
|
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
async def index():
|
async def index():
|
||||||
"""Base handler for /."""
|
|
||||||
return 'hai'
|
return 'hai'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue