Skip to content

Commit

Permalink
chore: do not try to disconnect ws if not connected (#2527)
Browse files Browse the repository at this point in the history
  • Loading branch information
yohanboniface authored Feb 26, 2025
2 parents 6e40388 + dc35039 commit fc6ea19
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions umap/sync/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,12 @@ async def connect(self):
self.client = redis.from_url(settings.REDIS_URL)

async def disconnect(self):
await self.client.hdel(self.room_key, self.peer_id)
for pubsub in self._subscriptions:
await pubsub.unsubscribe()
await pubsub.close()
await self.send_peers_list()
if self.is_authenticated:
await self.client.hdel(self.room_key, self.peer_id)
for pubsub in self._subscriptions:
await pubsub.unsubscribe()
await pubsub.close()
await self.send_peers_list()
await self.client.aclose()

async def send_peers_list(self):
Expand Down

0 comments on commit fc6ea19

Please sign in to comment.