@@ -30,7 +30,7 @@ export interface Invocation {
3030 */
3131 await ( ) : Promise < any > ;
3232
33- retry ( ) : Promise < void > ;
33+ retry ( retryCount : number ) : Promise < void > ;
3434}
3535
3636/**
@@ -41,7 +41,6 @@ export class ControlPlaneInvocation implements Invocation {
4141 private readonly input ?: FunctionInput ;
4242 private readonly functionCallJwt ?: string ;
4343 private inputJwt ?: string ;
44- private retryCount : number = 0 ;
4544
4645 private constructor (
4746 functionCallId : string ,
@@ -81,7 +80,7 @@ export class ControlPlaneInvocation implements Invocation {
8180 return await pollControlPlaneForOutput ( this . functionCallId , timeout ) ;
8281 }
8382
84- async retry ( ) : Promise < void > {
83+ async retry ( retryCount : number ) : Promise < void > {
8584 // we do not expect this to happen
8685 if ( ! this . input ) {
8786 throw new Error ( "Cannot retry function invocation - input missing" ) ;
@@ -90,15 +89,14 @@ export class ControlPlaneInvocation implements Invocation {
9089 const retryItem : FunctionRetryInputsItem = {
9190 inputJwt : this . inputJwt ! ,
9291 input : this . input ,
93- retryCount : this . retryCount ,
92+ retryCount : retryCount ,
9493 } ;
9594
9695 const functionRetryResponse = await client . functionRetryInputs ( {
9796 functionCallJwt : this . functionCallJwt ,
9897 inputs : [ retryItem ] ,
9998 } ) ;
10099 this . inputJwt = functionRetryResponse . inputJwts [ 0 ] ;
101- this . retryCount += 1 ;
102100 }
103101
104102 private static async execFunctionCall (
0 commit comments