mirror of
https://github.com/freelabz/secator
synced 2026-05-24 10:08:23 +00:00
fix(worker): prevent target duplication when running in worker mode (#1085)
Some checks are pending
release-please / release-please (push) Waiting to run
Tests / lint (3.11) (push) Waiting to run
Tests / unit (3.11) (push) Waiting to run
Tests / unit (3.8) (push) Waiting to run
Tests / integration (ubuntu-latest, 3.11) (push) Waiting to run
Tests / template (ubuntu-latest, 3.11) (push) Waiting to run
Tests / coverage (3.11) (push) Blocked by required conditions
Some checks are pending
release-please / release-please (push) Waiting to run
Tests / lint (3.11) (push) Waiting to run
Tests / unit (3.11) (push) Waiting to run
Tests / unit (3.8) (push) Waiting to run
Tests / integration (ubuntu-latest, 3.11) (push) Waiting to run
Tests / template (ubuntu-latest, 3.11) (push) Waiting to run
Tests / coverage (3.11) (push) Blocked by required conditions
Fixes #1069 When a task is dispatched via Celery (start_runner), both the Task runner and the command runner create Target objects for the same inputs. Since they share the same unique_name, self_targets counts both, reporting "Loaded 2 targets" instead of 1. Fixed by checking for existing Target names in prior results before creating new Target objects from inputs. Generated with [Claude Code](https://claude.ai/code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed an issue where duplicate target result entries were being created unnecessarily during runner initialization. The system now checks for existing target entries before instantiating new ones, eliminating redundant data and ensuring cleaner result sets. [](https://app.coderabbit.ai/change-stack/freelabz/secator/pull/1085) <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Olivier Cervello <ocervell@users.noreply.github.com>
This commit is contained in:
parent
3a87b099cc
commit
b30e21355a
1 changed files with 4 additions and 3 deletions
|
|
@ -198,9 +198,10 @@ class Runner:
|
|||
self.debug(f'resolving inputs with {len(self.dynamic_opts)} dynamic opts', obj=self.dynamic_opts, sub='init')
|
||||
self.inputs = [inputs] if not isinstance(inputs, list) else inputs
|
||||
self.inputs = list(set(self.inputs))
|
||||
targets = [Target(name=target) for target in self.inputs]
|
||||
for target in targets:
|
||||
self.add_result(target, print=False, output=False)
|
||||
if self.caller != 'Task':
|
||||
targets = [Target(name=target) for target in self.inputs]
|
||||
for target in targets:
|
||||
self.add_result(target, print=False, output=False)
|
||||
|
||||
# Run extractors on results
|
||||
self._run_extractors()
|
||||
|
|
|
|||
Loading…
Reference in a new issue