Spaces:
Sleeping
Sleeping
Ekimart commited on
Commit ·
26cd7c2
1
Parent(s): 1d8ad25
Simplifier le point d'entrée principal en encapsulant l'initialisation dans une fonction `main` et ajuster `_lifespan` pour utiliser un paramètre non utilisé.
Browse files
main.py
CHANGED
|
@@ -71,7 +71,7 @@ class WebSocketNotificationService:
|
|
| 71 |
)
|
| 72 |
|
| 73 |
@asynccontextmanager
|
| 74 |
-
async def _lifespan(self,
|
| 75 |
self.logger.info("🚀 Starting WebSocket notification service")
|
| 76 |
|
| 77 |
try:
|
|
@@ -403,7 +403,10 @@ class WebSocketNotificationService:
|
|
| 403 |
)
|
| 404 |
|
| 405 |
|
| 406 |
-
|
| 407 |
service = WebSocketNotificationService()
|
| 408 |
service.run()
|
| 409 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
)
|
| 72 |
|
| 73 |
@asynccontextmanager
|
| 74 |
+
async def _lifespan(self, _app: FastAPI):
|
| 75 |
self.logger.info("🚀 Starting WebSocket notification service")
|
| 76 |
|
| 77 |
try:
|
|
|
|
| 403 |
)
|
| 404 |
|
| 405 |
|
| 406 |
+
def main():
|
| 407 |
service = WebSocketNotificationService()
|
| 408 |
service.run()
|
| 409 |
+
|
| 410 |
+
|
| 411 |
+
if __name__ == "__main__":
|
| 412 |
+
main()
|