init.py 文件源码

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

项目:sentinel-old 作者: monacocoin-net 项目源码 文件源码
def is_database_correctly_configured():
    import peewee
    import config

    configured = False

    cannot_connect_message = "Cannot connect to database. Please ensure database service is running and user access is properly configured in 'sentinel.conf'."

    try:
        db = config.db
        db.connect()
        configured = True
    except (peewee.ImproperlyConfigured, peewee.OperationalError, ImportError) as e:
        print("[error]: %s" % e)
        print(cannot_connect_message)
        sys.exit(1)

    return configured
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号