WIP2
This commit is contained in:
@ -97,7 +97,10 @@ class CallDispatcher:
|
||||
risotto_context.function = function_obj['function']
|
||||
if function_obj['risotto_context']:
|
||||
kw['risotto_context'] = risotto_context
|
||||
if function_obj['database']:
|
||||
# do not start a new database connection
|
||||
if function_obj['database'] and hasattr(old_risotto_context, 'connection'):
|
||||
risotto_context.connection = old_risotto_context.connection
|
||||
if function_obj['database'] and not hasattr(risotto_context, 'connection'):
|
||||
db_conf = get_config().get('database')
|
||||
pool = await asyncpg.create_pool(database=db_conf.get('dbname'), user=db_conf.get('user'))
|
||||
async with pool.acquire() as connection:
|
||||
|
Reference in New Issue
Block a user