From 40242015ee584c5af07ad6150c45f6c3252b29f8 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Mon, 21 Apr 2025 13:03:09 +0100 Subject: [PATCH] Fix lost ID --- trustgraph-base/trustgraph/base/async_processor.py | 10 +++++----- trustgraph-base/trustgraph/base/flow_processor.py | 3 --- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/trustgraph-base/trustgraph/base/async_processor.py b/trustgraph-base/trustgraph/base/async_processor.py index 0f21b491..80440b36 100644 --- a/trustgraph-base/trustgraph/base/async_processor.py +++ b/trustgraph-base/trustgraph/base/async_processor.py @@ -126,14 +126,14 @@ class AsyncProcessor: # Startup fabric. This runs in 'async' mode, creates a taskgroup and # runs the producer. @classmethod - async def launch_async(cls, args, ident): + async def launch_async(cls, args): try: # Create a taskgroup. This seems complicated, when an exception # occurs, unhandled it looks like it cancels all threads in the - # taskgroup, but I have observed this not working. I think - # it's fixed now that exceptions are caught in the right place. + # taskgroup. Needs the exception to be caught in the right + # place. async with asyncio.TaskGroup() as tg: @@ -141,7 +141,7 @@ class AsyncProcessor: # as a paramter. A processor identity ident is used as # - subscriber name # - an identifier for flow configuration - p = cls(**args | { "taskgroup": tg, "id": ident }) + p = cls(**args | { "taskgroup": tg }) # Start the processor await p.start() @@ -197,7 +197,7 @@ class AsyncProcessor: # Launch the processor in an asyncio handler asyncio.run(cls.launch_async( - args, ident + args )) except KeyboardInterrupt: diff --git a/trustgraph-base/trustgraph/base/flow_processor.py b/trustgraph-base/trustgraph/base/flow_processor.py index 0552eb9c..d96c9345 100644 --- a/trustgraph-base/trustgraph/base/flow_processor.py +++ b/trustgraph-base/trustgraph/base/flow_processor.py @@ -111,7 +111,4 @@ class FlowProcessor(AsyncProcessor): # help=f'Rate limit timeout (default: {default_rate_limit_timeout})' # ) -def run(): - - Processor.launch(module, __doc__)