Skip to content

Commit 34839bb

Browse files
committed
test: blocking execution until the message is published
1 parent 9b385e2 commit 34839bb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

api/src/scripts/load_dataset_on_create.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def publish(feed: Feed, topic_path: str):
6767
data_bytes = json.dumps(payload).encode("utf-8")
6868
future = get_pubsub_client().publish(topic_path, data=data_bytes)
6969
future.add_done_callback(lambda _: publish_callback(future, feed.stable_id, topic_path))
70+
# Block until the message is published
71+
future.result() # This will wait until the publishing is confirmed
7072

7173

7274
def publish_all(feeds: List[Feed]):

0 commit comments

Comments
 (0)