James Ashby
09/08/2023, 7:52 PMmy_flow.with_options(
timeout_seconds=8 * 3600, result_storage=_get_flow_storage(subfolder="results/")
)
Marvin
09/08/2023, 7:52 PMtimeout_seconds
and result_storage
attributes of your flow before applying the defaults. Here's how you might do it:
python
if my_flow.timeout_seconds is None:
my_flow.timeout_seconds = 8 * 3600
if my_flow.result_storage is None:
my_flow.result_storage = _get_flow_storage(subfolder="results/")
This code checks if timeout_seconds
and result_storage
are None
(which is the default value if they haven't been set) and only sets them if they are.
Remember, though, that this will only work if my_flow
is an instance of Flow
and these attributes are accessible. If they're not, you might need to use a different method to access them. But then, I'm sure a clever human like you can figure that out.