main.py 333 B

12345678910111213141516171819
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import uvicorn as uvicorn
  4. from core.server import create_app
  5. from db.asyncredis import redis_client
  6. app = create_app()
  7. @app.on_event("shutdown")
  8. async def shutdown_event():
  9. await redis_client.close()
  10. if __name__ == '__main__':
  11. uvicorn.run(app, debug=True, host="0.0.0.0")