File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -74,13 +74,6 @@ export class MetricsListener {
7474 }
7575
7676 public async onStartInvocation ( _ : any , context ?: Context ) {
77- // We get the API key in onStartInvocation rather than in the constructor because in busy functions,
78- // initialization may occur more than 5 minutes before the first invocation (due to proactive initialization),
79- // resulting in AWS errors: https://github.com/aws/aws-sdk-js-v3/issues/5192#issuecomment-2073243617
80- if ( ! this . apiKey ) {
81- this . apiKey = this . getAPIKey ( this . config ) ;
82- }
83-
8477 if ( this . isExtensionRunning === undefined ) {
8578 this . isExtensionRunning = await isExtensionRunning ( ) ;
8679 logDebug ( `Extension present: ${ this . isExtensionRunning } ` ) ;
@@ -98,6 +91,12 @@ export class MetricsListener {
9891 return ;
9992 }
10093
94+ // We get the API key in onStartInvocation rather than in the constructor because in busy functions,
95+ // initialization may occur more than 5 minutes before the first invocation (due to proactive initialization),
96+ // resulting in AWS errors: https://github.com/aws/aws-sdk-js-v3/issues/5192#issuecomment-2073243617
97+ if ( ! this . apiKey ) {
98+ this . apiKey = this . getAPIKey ( this . config ) ;
99+ }
101100 this . currentProcessor = this . createProcessor ( this . config , this . apiKey ) ;
102101 }
103102
You can’t perform that action at this time.
0 commit comments