File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ use taurus_core::context::context::Context;
1919use taurus_core:: context:: executor:: Executor ;
2020use taurus_core:: context:: registry:: FunctionStore ;
2121use taurus_core:: context:: signal:: Signal ;
22+ use taurus_core:: runtime:: error:: RuntimeError ;
2223use tokio:: signal;
2324use tokio:: time:: sleep;
2425use tonic_health:: pb:: health_server:: HealthServer ;
@@ -41,6 +42,20 @@ fn handle_message(
4142 None => Context :: default ( ) ,
4243 } ;
4344
45+ if flow. node_functions . is_empty ( ) {
46+ let duration_millis = start. elapsed ( ) . as_millis ( ) as i64 ;
47+ return (
48+ Signal :: Failure ( RuntimeError :: simple_str (
49+ "InvalidFlow" ,
50+ "This flow has no nodes to execute!" ,
51+ ) ) ,
52+ RuntimeUsage {
53+ flow_id : flow. flow_id ,
54+ duration : duration_millis,
55+ } ,
56+ ) ;
57+ }
58+
4459 let node_functions: HashMap < i64 , NodeFunction > = flow
4560 . node_functions
4661 . into_iter ( )
You can’t perform that action at this time.
0 commit comments