-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(commands): fix error on command notifications #2323
base: dev
Are you sure you want to change the base?
Conversation
131b44c
to
a5bb352
Compare
6a0face
to
8ea2595
Compare
antarest/study/storage/variantstudy/variant_command_generator.py
Outdated
Show resolved
Hide resolved
antarest/study/storage/variantstudy/variant_command_generator.py
Outdated
Show resolved
Hide resolved
d6f6678
to
488597f
Compare
6eb3ae4
to
175e5ad
Compare
175e5ad
to
1845678
Compare
antarest/study/storage/variantstudy/variant_command_generator.py
Outdated
Show resolved
Hide resolved
antarest/study/storage/variantstudy/variant_command_generator.py
Outdated
Show resolved
Hide resolved
…ng step, add comments,
…and_generator, change the call to notifier in _generate
… unnecessary lines and variables, check types
baaebb8
to
6e3adef
Compare
@@ -9,3 +9,6 @@ | |||
# SPDX-License-Identifier: MPL-2.0 | |||
# | |||
# This file is part of the Antares project. | |||
import typing as t | |||
|
|||
CommandNotifier = t.Callable[[int, bool, str], None] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for this
if notifier: | ||
notifier(index - 1, output.status, output.message) | ||
if notifier and cmd.command_id not in command_block_set: | ||
notifier(command_block_dict[cmd.command_id], output.status, output.message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maugde @MartinBelthle :
Actually it's weird to notify only on the first command of a block.
In particular, we will notify with the status of this first command, but not for subsequent commands:
so for example if the first command succeeds and the second one fails, it will be invisible from the listener.
In the end I would propose to change the scope of this work:
I think the notification mechanism is actually not used (it just sends an event to the event bus, but this event type is never used for now. I cannot see a usage in the near future.
--> I propose to simply delete this notifier and the associated event type
fix ANT-2511