Skip to content

Commit 6e7de6f

Browse files
committed
Merge branch 'main' into update-watch
2 parents 33b8714 + 9ac0cd6 commit 6e7de6f

File tree

1 file changed

+10
-1
lines changed
  • examples/amazon_s3_embedding

1 file changed

+10
-1
lines changed

examples/amazon_s3_embedding/main.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,16 @@ def _main() -> None:
101101
pool = ConnectionPool(os.getenv("COCOINDEX_DATABASE_URL"))
102102

103103
amazon_s3_text_embedding_flow.setup()
104-
with cocoindex.FlowLiveUpdater(amazon_s3_text_embedding_flow):
104+
with cocoindex.FlowLiveUpdater(amazon_s3_text_embedding_flow) as updater:
105+
updater.abort()
106+
updater.wait()
107+
108+
while True:
109+
updates = updater.next_status_updates()
110+
print(f"Updates: {updates}")
111+
if not updates.active_sources:
112+
break
113+
105114
# Run queries in a loop to demonstrate the query capabilities.
106115
while True:
107116
query = input("Enter search query (or Enter to quit): ")

0 commit comments

Comments
 (0)