Skip to content

Commit

Permalink
[fix] Wait for pub-sub messages to arrive
Browse files Browse the repository at this point in the history
  • Loading branch information
aquamatthias committed Sep 25, 2024
1 parent 5bf6ca9 commit c6f80d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion fixcloudutils/redis/pub_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def __init__(self, redis: Redis, channel: str, handler: MessageHandler) -> None:
async def start(self) -> None:
async def read_messages(pubsub: PubSub) -> None:
while True:
msg = await pubsub.get_message(ignore_subscribe_messages=True)
# timeout: waiting time for a message to be received in seconds
msg = await pubsub.get_message(ignore_subscribe_messages=True, timeout=30)
try:
if msg is not None:
data = json.loads(msg["data"])
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "fixcloudutils"
version = "1.15.0"
version = "1.15.1"
authors = [{ name = "Some Engineering Inc." }]
description = "Utilities for fixcloud."
license = { file = "LICENSE" }
Expand Down

0 comments on commit c6f80d6

Please sign in to comment.