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