mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-26 13:41:02 +02:00
Fixed block structure problem
This commit is contained in:
parent
05f3533553
commit
a875d46e4d
1 changed files with 13 additions and 10 deletions
|
|
@ -188,20 +188,23 @@ async def async_main(queues, output_file, pulsar_host, listener_name, subscriber
|
||||||
|
|
||||||
# Start monitoring tasks
|
# Start monitoring tasks
|
||||||
try:
|
try:
|
||||||
async with asyncio.TaskGroup() as tg:
|
try:
|
||||||
# Create one monitor task per subscriber
|
async with asyncio.TaskGroup() as tg:
|
||||||
for queue_name, sub in subscribers:
|
# Create one monitor task per subscriber
|
||||||
tg.create_task(monitor_queue(sub, queue_name, central_queue, "logger"))
|
for queue_name, sub in subscribers:
|
||||||
|
tg.create_task(monitor_queue(sub, queue_name, central_queue, "logger"))
|
||||||
|
|
||||||
# Create single writer task
|
# Create single writer task
|
||||||
tg.create_task(log_writer(central_queue, f))
|
tg.create_task(log_writer(central_queue, f))
|
||||||
|
|
||||||
|
except* Exception as eg:
|
||||||
|
# TaskGroup exception group
|
||||||
|
for exc in eg.exceptions:
|
||||||
|
if not isinstance(exc, asyncio.CancelledError):
|
||||||
|
print(f"Task error: {exc}", file=sys.stderr)
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("\n\nStopping...")
|
print("\n\nStopping...")
|
||||||
except* Exception as eg:
|
|
||||||
# TaskGroup exception group
|
|
||||||
for exc in eg.exceptions:
|
|
||||||
print(f"Task error: {exc}", file=sys.stderr)
|
|
||||||
finally:
|
finally:
|
||||||
# Write session end marker
|
# Write session end marker
|
||||||
f.write(f"\n{'#'*80}\n")
|
f.write(f"\n{'#'*80}\n")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue