Skip to content

Commit

Permalink
chg: [pubsub] Handle redis ConnectionError in stream function.
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricbonhomme committed Dec 10, 2024
1 parent 5de4b11 commit bdb3dad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions website/web/views/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def stream() -> Generator[str, None, None]:
yield f"data: {json_message}\n\n"
except GeneratorExit:
pubsub.unsubscribe(topic)
except redis.exceptions.ConnectionError:
return
finally:
pubsub.close()

Expand Down

0 comments on commit bdb3dad

Please sign in to comment.