@@ -12,24 +12,27 @@ import { startBlockedMonitor } from './utils/blockedMonitor';
12
12
import { isEnvironmentVariableSet } from './utils/util' ;
13
13
14
14
export 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 ) {
17
21
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'
19
23
) ;
20
24
// Find which arguments are in error
21
25
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 } ` ) ;
27
30
28
31
throw new AzFuncSystemError ( `gRPC client connection info is missing or incorrect (${ debugInfo . join ( ', ' ) } ).` ) ;
29
32
}
30
33
worker . id = workerId ;
31
34
32
- const connection = ` ${ host } : ${ port } ` ;
35
+ const connection = new URL ( uri ) . host ;
33
36
systemLog ( `Worker ${ workerId } connecting on ${ connection } ` ) ;
34
37
35
38
try {
0 commit comments