代码拉取完成,页面将自动刷新
"""
Script for checking that a database server is available.
Essentially a cross-platform, database agnostic mysqladmin.
"""
import time
from sqlalchemy import create_engine
from sqlalchemy.engine.url import make_url
from CTFd.config import Config
url = make_url(Config.DATABASE_URL)
# Ignore sqlite databases
if url.drivername.startswith("sqlite"):
exit(0)
# Null out the database so raw_connection doesnt error if it doesnt exist
# CTFd will create the database if it doesnt exist
url.database = None
# Wait for the database server to be available
engine = create_engine(url)
print(f"Waiting for {url} to be ready")
while True:
try:
engine.raw_connection()
break
except Exception:
print(".", end="", flush=True)
time.sleep(1)
print(f"{url} is ready")
time.sleep(1)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。