complete_on_downloads for task block (#403)
This commit is contained in:
@@ -71,6 +71,14 @@ class Block(BaseModel, abc.ABC):
|
||||
workflow_run_id: str,
|
||||
value: dict[str, Any] | list | str | None = None,
|
||||
) -> None:
|
||||
if workflow_run_context.has_value(self.output_parameter.key):
|
||||
LOG.warning(
|
||||
"Output parameter value already recorded",
|
||||
output_parameter_id=self.output_parameter.output_parameter_id,
|
||||
workflow_run_id=workflow_run_id,
|
||||
)
|
||||
return
|
||||
|
||||
await workflow_run_context.register_output_parameter_value_post_execution(
|
||||
parameter=self.output_parameter,
|
||||
value=value,
|
||||
@@ -150,6 +158,7 @@ class TaskBlock(Block):
|
||||
max_retries: int = 0
|
||||
max_steps_per_run: int | None = None
|
||||
parameters: list[PARAMETER_TYPE] = []
|
||||
complete_on_download: bool = False
|
||||
|
||||
def get_all_parameters(
|
||||
self,
|
||||
@@ -265,6 +274,7 @@ class TaskBlock(Block):
|
||||
task=task,
|
||||
step=step,
|
||||
workflow_run=workflow_run,
|
||||
complete_on_download=self.complete_on_download,
|
||||
)
|
||||
except Exception as e:
|
||||
# Make sure the task is marked as failed in the database before raising the exception
|
||||
|
||||
@@ -87,6 +87,7 @@ class TaskBlockYAML(BlockYAML):
|
||||
max_retries: int = 0
|
||||
max_steps_per_run: int | None = None
|
||||
parameter_keys: list[str] | None = None
|
||||
complete_on_download: bool = False
|
||||
|
||||
|
||||
class ForLoopBlockYAML(BlockYAML):
|
||||
|
||||
Reference in New Issue
Block a user