@@ -12,24 +12,27 @@ import { startBlockedMonitor } from './utils/blockedMonitor';
1212import { isEnvironmentVariableSet } from './utils/util' ;
1313
1414export function startNodeWorker ( args ) {
15- const { host, port, workerId, requestId, grpcMaxMessageLength } = parseArgs ( args . slice ( 2 ) ) ;
16- if ( ! host || ! port || ! workerId || ! requestId || ! grpcMaxMessageLength ) {
15+ const parsedArgs = parseArgs ( args . slice ( 2 ) ) ;
16+ const uri = parsedArgs [ 'functions-uri' ] ;
17+ const workerId = parsedArgs [ 'functions-worker-id' ] ;
18+ const requestId = parsedArgs [ 'functions-request-id' ] ;
19+ const grpcMaxMessageLength = parsedArgs [ 'functions-grpc-max-message-length' ] ;
20+ if ( ! uri || ! workerId || ! requestId || ! grpcMaxMessageLength ) {
1721 systemLog (
18- 'usage --host hostName --port portNumber --workerId workerId --requestId requestId --grpcMaxMessageLength grpcMaxMessageLength'
22+ 'usage --functions-uri uri --functions-worker-id workerId --functions-request-id requestId --functions-grpc-max-message-length grpcMaxMessageLength'
1923 ) ;
2024 // Find which arguments are in error
2125 const debugInfo : string [ ] = [ ] ;
22- if ( ! host ) debugInfo . push ( `'hostName' is ${ host } ` ) ;
23- if ( ! port ) debugInfo . push ( `'port' is ${ port } ` ) ;
24- if ( ! workerId ) debugInfo . push ( `'workerId' is ${ workerId } ` ) ;
25- if ( ! requestId ) debugInfo . push ( `'requestId' is ${ requestId } ` ) ;
26- if ( ! grpcMaxMessageLength ) debugInfo . push ( `'grpcMaxMessageLength' is ${ grpcMaxMessageLength } ` ) ;
26+ if ( ! uri ) debugInfo . push ( `'functions-uri' is ${ uri } ` ) ;
27+ if ( ! workerId ) debugInfo . push ( `'functions-worker-id' is ${ workerId } ` ) ;
28+ if ( ! requestId ) debugInfo . push ( `'functions-request-id' is ${ requestId } ` ) ;
29+ if ( ! grpcMaxMessageLength ) debugInfo . push ( `'functions-grpc-max-message-length' is ${ grpcMaxMessageLength } ` ) ;
2730
2831 throw new AzFuncSystemError ( `gRPC client connection info is missing or incorrect (${ debugInfo . join ( ', ' ) } ).` ) ;
2932 }
3033 worker . id = workerId ;
3134
32- const connection = ` ${ host } : ${ port } ` ;
35+ const connection = new URL ( uri ) . host ;
3336 systemLog ( `Worker ${ workerId } connecting on ${ connection } ` ) ;
3437
3538 try {
0 commit comments