本文整理汇总了Python中sqlalchemy.pool.clear_managers函数的典型用法代码示例。如果您正苦于以下问题:Python clear_managers函数的具体用法?Python clear_managers怎么用?Python clear_managers使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clear_managers函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: get_pool
def get_pool():
"""Create one and only one pool using the configured settings."""
global MYSQLPOOL
if MYSQLPOOL is None:
backend_name = getattr(settings, 'MYSQLPOOL_BACKEND', DEFAULT_BACKEND)
backend = getattr(pool, backend_name)
kwargs = getattr(settings, 'MYSQLPOOL_ARGUMENTS', {})
kwargs.setdefault('poolclass', backend)
kwargs.setdefault('recycle', DEFAULT_POOL_TIMEOUT)
MYSQLPOOL = pool.manage(OldDatabase, **kwargs)
setattr(MYSQLPOOL, '_pid', os.getpid())
if getattr(MYSQLPOOL, '_pid', None) != os.getpid():
pool.clear_managers()
return MYSQLPOOL
开发者ID:samozihu,项目名称:django-mysqlpool,代码行数:15,代码来源:base.py
示例2: get_pool
def get_pool():
"Creates one and only one pool using the configured settings."
global MYSQLPOOL
if MYSQLPOOL is None:
backend = getattr(settings, 'MYSQLPOOL_BACKEND', MYSQLPOOL_BACKEND)
backend = getattr(pool, backend)
kwargs = getattr(settings, 'MYSQLPOOL_ARGUMENTS', {})
kwargs.setdefault('poolclass', backend)
# The user can override this, but set it by default for safety.
kwargs.setdefault('recycle', MYSQLPOOL_TIMEOUT)
MYSQLPOOL = pool.manage(OldDatabase, **kwargs)
setattr(MYSQLPOOL, '_pid', os.getpid())
if getattr(MYSQLPOOL, '_pid', None) != os.getpid():
pool.clear_managers()
return MYSQLPOOL
开发者ID:butterhuang,项目名称:django-mysqlpool,代码行数:15,代码来源:base.py
示例3: get_pool
def get_pool():
"""Create one and only one pool using the configured settings."""
global MYSQLPOOL
if MYSQLPOOL is None:
backend_name = getattr(settings, "SHIELD_MYSQL_POOL_BACKEND", DEFAULT_BACKEND)
backend = getattr(local_pool, backend_name)
kwargs = getattr(settings, "SHIELD_MYSQL_POOL_ARGUMENTS", {})
kwargs.setdefault("poolclass", backend)
kwargs.setdefault("recycle", DEFAULT_POOL_TIMEOUT)
MYSQLPOOL = sa_pool.manage(OldDatabase, **kwargs)
setattr(MYSQLPOOL, "_pid", os.getpid())
if getattr(MYSQLPOOL, "_pid", None) != os.getpid():
sa_pool.clear_managers()
return MYSQLPOOL
开发者ID:torpedoallen,项目名称:shield_mysql_pool,代码行数:15,代码来源:base.py
示例4: close_pool
def close_pool():
pool.clear_managers()
开发者ID:namongk,项目名称:django-mysqlpool,代码行数:2,代码来源:base.py
示例5: teardown_class
def teardown_class(cls):
pool.clear_managers()
开发者ID:kihon10,项目名称:sqlalchemy,代码行数:2,代码来源:test_pool.py
示例6: setup
def setup(self):
pool.clear_managers()
开发者ID:kihon10,项目名称:sqlalchemy,代码行数:2,代码来源:test_pool.py
示例7: tearDownAll
def tearDownAll(self):
pool.clear_managers()
开发者ID:jrus,项目名称:sqlalchemy,代码行数:2,代码来源:pool.py
示例8: setup
def setup(self):
pool.clear_managers()
self._teardown_conns = []
开发者ID:ajtowns,项目名称:sqlalchemy,代码行数:3,代码来源:test_pool.py
注:本文中的sqlalchemy.pool.clear_managers函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论