live-opensipkd

1 parent 95920c62
......@@ -37,6 +37,7 @@ from ..read_conf import (
allowed_ips,
get_conf,
name_conf,
get_str, get_int
)
......@@ -606,14 +607,18 @@ def get_db(conf_file):
if 'main' not in conf.sections():
return
settings = conf['main']
if 'sqlalchemy.url' not in settings:
#settings = conf.sections()
#print settings, settings['main']
#if 'sqlalchemy.url' not in settings:
# log_message('SQL URL Not Foune')
# return
pool_size = get_int(conf, 'main', 'pool_size', 5)
max_overflow = get_int(conf, 'main', 'max_overflow', 10)
url = get_str(conf, 'main', 'sqlalchemy.url',None)
if not url:
return
pool_size = 'pool_size' in settings and int(settings['pool_size']) or 5
max_overflow = 'max_overflow' in settings and int(settings['max_overflow']) or 10
url = settings['sqlalchemy.url']
print(url, pool_size, max_overflow)
engine = create_engine(url,
max_overflow=max_overflow,
pool_size=pool_size)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!