mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-24 20:51: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
|
||||
try:
|
||||
async with asyncio.TaskGroup() as tg:
|
||||
# Create one monitor task per subscriber
|
||||
for queue_name, sub in subscribers:
|
||||
tg.create_task(monitor_queue(sub, queue_name, central_queue, "logger"))
|
||||
try:
|
||||
async with asyncio.TaskGroup() as tg:
|
||||
# Create one monitor task per subscriber
|
||||
for queue_name, sub in subscribers:
|
||||
tg.create_task(monitor_queue(sub, queue_name, central_queue, "logger"))
|
||||
|
||||
# Create single writer task
|
||||
tg.create_task(log_writer(central_queue, f))
|
||||
# Create single writer task
|
||||
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:
|
||||
print("\n\nStopping...")
|
||||
except* Exception as eg:
|
||||
# TaskGroup exception group
|
||||
for exc in eg.exceptions:
|
||||
print(f"Task error: {exc}", file=sys.stderr)
|
||||
finally:
|
||||
# Write session end marker
|
||||
f.write(f"\n{'#'*80}\n")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue