File tree 1 file changed +7
-14
lines changed
updates_and_signals/safe_message_handlers/src
1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -44,19 +44,12 @@ export async function clusterManagerWorkflow(input: ClusterManagerInput): Promis
44
44
//
45
45
// The cluster manager workflow is a long-running workflow ("entity" workflow). Most of its logic
46
46
// lies in the message-processing handlers implented in the ClusterManager class. The main
47
- // workflow itself is a loop that does the following:
48
- // - process messages
49
- // - continue-as-new when suggested
50
- //
51
- await wf . condition ( ( ) => manager . state . clusterStarted ) ;
52
- for ( ; ; ) {
53
- await wf . condition ( ( ) => manager . state . clusterShutdown || wf . workflowInfo ( ) . continueAsNewSuggested ) ;
54
- if ( manager . state . clusterShutdown ) {
55
- break ;
56
- }
57
- if ( wf . workflowInfo ( ) . continueAsNewSuggested ) {
58
- await wf . continueAsNew < typeof clusterManagerWorkflow > ( { state : manager . getState ( ) } ) ;
59
- }
47
+ // workflow itself simply waits until the cluster is shutdown, or the workflow needs to
48
+ // continue-as-new.
49
+ await wf . condition ( ( ) => manager . state . clusterShutdown || wf . workflowInfo ( ) . continueAsNewSuggested ) ;
50
+ if ( wf . workflowInfo ( ) . continueAsNewSuggested ) {
51
+ await wf . continueAsNew < typeof clusterManagerWorkflow > ( { state : manager . getState ( ) } ) ;
52
+ } else {
53
+ return manager . getStateSummary ( ) ;
60
54
}
61
- return manager . getStateSummary ( ) ;
62
55
}
You can’t perform that action at this time.
0 commit comments