plugin.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:maas 作者: maas 项目源码 文件源码
def _ensureConnection(self):
        # If connection is already made close it.
        from django.db import connection
        if connection.connection is not None:
            connection.close()

        # Loop forever until a connection can be made.
        while True:
            try:
                connection.ensure_connection()
            except Exception:
                log.err(_why=(
                    "Error starting: "
                    "Connection to database cannot be established."))
                time.sleep(1)
            else:
                # Connection made, now close it.
                connection.close()
                break
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号