We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d2333a commit 92aae1bCopy full SHA for 92aae1b
oioioi/notifications/server/server.py
@@ -1,3 +1,4 @@
1
+import sys
2
from typing import Union
3
from socketify import App, OpCode, WebSocket
4
import json
@@ -33,8 +34,16 @@ def run(self) -> None:
33
34
self.app.run()
35
36
async def on_start(self) -> None:
- await self.auth.connect()
37
- await self.queue.connect()
+ try:
38
+ await self.auth.connect()
39
+ await self.queue.connect()
40
+ self.logger.info("Notification server started successfully")
41
+ except Exception as e:
42
+ self.logger.error(f"""
43
+ Error starting notification server: {str(e)}.
44
+ This usually means a configuration error related to RabbitMQ. Closing server.
45
+ """)
46
+ sys.exit(1)
47
48
def on_ws_upgrade(self, res, req, socket_context):
49
"""
0 commit comments