File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { validateSnapshot } from './schemaValidation.js'
77import { pingIntervalId } from './utils.js' ;
88import { startPolling } from './utils.js' ;
99
10+ const uploadDomToS3ViaEnv = process . env . USE_LAMBDA_INTERNAL || false ;
1011export default async ( ctx : Context ) : Promise < FastifyInstance < Server , IncomingMessage , ServerResponse > > => {
1112
1213 const server : FastifyInstance < Server , IncomingMessage , ServerResponse > = fastify ( {
@@ -105,8 +106,16 @@ export default async (ctx: Context): Promise<FastifyInstance<Server, IncomingMes
105106 if ( ctx . server ) {
106107 ctx . server . close ( ) ;
107108 }
108- let resp = await ctx . client . getS3PreSignedURL ( ctx ) ;
109- await ctx . client . uploadLogs ( ctx , resp . data . url ) ;
109+
110+ let uploadCLILogsToS3 = ctx ?. config ?. useLambdaInternal || uploadDomToS3ViaEnv ;
111+ if ( ! uploadCLILogsToS3 ) {
112+ ctx . log . debug ( `Log file to be uploaded` )
113+ let resp = await ctx . client . getS3PreSignedURL ( ctx ) ;
114+ await ctx . client . uploadLogs ( ctx , resp . data . url ) ;
115+ } else {
116+ ctx . log . debug ( `Log file to be uploaded via LSRS` )
117+ let resp = ctx . client . sendCliLogsToLSRS ( ctx ) ;
118+ }
110119
111120 if ( pingIntervalId !== null ) {
112121 clearInterval ( pingIntervalId ) ;
You can’t perform that action at this time.
0 commit comments