Files
new_lottery_bot/scripts/wait_database.py
Trevor1985 cb35bb12e3
Some checks failed
continuous-integration/drone/push Build is failing
Stabilize staff concurrency and premium emoji; enable verified Drone deployment
2026-09-13 19:48:41 +09:00

25 lines
575 B
Python

import asyncio
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from sqlalchemy import text
from src.core.database import engine
async def main():
for attempt in range(30):
try:
async with engine.connect() as connection:
await connection.execute(text("SELECT 1"))
await engine.dispose()
return
except Exception:
if attempt == 29:
raise
await asyncio.sleep(1)
if __name__ == "__main__":
asyncio.run(main())