Skip to content

Commit f4b3d7e

Browse files
committed
update FlowBuilder to use PersistenceContext for accessing setup states
1 parent 465ecb0 commit f4b3d7e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/builder/flow_builder.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,16 @@ impl FlowBuilder {
259259
pub fn new(name: &str) -> PyResult<Self> {
260260
let lib_context = get_lib_context().into_py_result()?;
261261
let existing_flow_ss = lib_context
262-
.require_all_setup_states()
263-
.into_py_result()?
264-
.read()
265-
.unwrap()
266-
.flows
267-
.get(name)
268-
.cloned();
262+
.persistence_ctx
263+
.as_ref()
264+
.and_then(|ctx| {
265+
ctx.all_setup_states
266+
.read()
267+
.unwrap()
268+
.flows
269+
.get(name)
270+
.cloned()
271+
});
269272
let root_op_scope = OpScope::new(
270273
spec::ROOT_SCOPE_NAME.to_string(),
271274
None,

0 commit comments

Comments
 (0)