Skip to content

Commit

Permalink
fix: protocol disconnect handling
Browse files Browse the repository at this point in the history
  • Loading branch information
LWJ0513 committed Mar 10, 2024
1 parent 53e4007 commit 68b864c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions backend/games/consumers/GameConsumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,13 +496,22 @@ async def _send_in_game_message(self, match, group_name):
})

async def game_info(self, event):
await self.send(text_data=json.dumps(event))
try:
await self.send(text_data=json.dumps(event))
except autobahn.exception.Disconnected:
logger.info("autobahn.exception.Disconnected: Attempt to send on a closed protocol 발생")

async def game_start(self, event):
await self.send(text_data=json.dumps(event))
try:
await self.send(text_data=json.dumps(event))
except autobahn.exception.Disconnected:
logger.info("autobahn.exception.Disconnected: Attempt to send on a closed protocol 발생")

async def in_game(self, event):
await self.send(text_data=json.dumps(event))
try:
await self.send(text_data=json.dumps(event))
except autobahn.exception.Disconnected:
logger.info("autobahn.exception.Disconnected: Attempt to send on a closed protocol 발생")

async def game_end(self, event):
await self.send(text_data=json.dumps(event))
Expand Down

0 comments on commit 68b864c

Please sign in to comment.