@@ -17,7 +17,7 @@ export const deleteJobUpdate = wf.defineUpdate<void, [DeleteJobUpdateInput]>('de
1717export const getClusterStatusQuery = wf . defineQuery < ClusterManagerStateSummary > ( 'getClusterStatus' ) ;
1818
1919export async function clusterManagerWorkflow ( input : ClusterManagerInput = { } ) : Promise < ClusterManagerStateSummary > {
20- const manager = new ClusterManager ( input . state ) ;
20+ const manager = new ClusterManager ( input ) ;
2121 //
2222 // Message-handling API
2323 //
@@ -52,7 +52,7 @@ export async function clusterManagerWorkflow(input: ClusterManagerInput = {}): P
5252 // continue-as-new.
5353 await wf . condition ( ( ) => manager . state . clusterState === ClusterState . STARTED ) ;
5454 await wf . condition (
55- ( ) => manager . state . clusterState === ClusterState . SHUTTING_DOWN || wf . workflowInfo ( ) . continueAsNewSuggested
55+ ( ) => manager . state . clusterState === ClusterState . SHUTTING_DOWN || manager . shouldContinueAsNew ( )
5656 ) ;
5757 if ( manager . state . clusterState !== ClusterState . SHUTTING_DOWN ) {
5858 // You should typically wait for all async handlers to finish before
@@ -62,7 +62,10 @@ export async function clusterManagerWorkflow(input: ClusterManagerInput = {}): P
6262 // new. This sample does not schedule any activities or child workflows, so
6363 // it is sufficient just to wait for handlers to finish.
6464 await wf . condition ( wf . allHandlersFinished ) ;
65- return await wf . continueAsNew < typeof clusterManagerWorkflow > ( { state : manager . getState ( ) } ) ;
65+ return await wf . continueAsNew < typeof clusterManagerWorkflow > ( {
66+ state : manager . getState ( ) ,
67+ testContinueAsNew : input . testContinueAsNew
68+ } ) ;
6669 } else {
6770 return manager . getStateSummary ( ) ;
6871 }
0 commit comments