File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -240,8 +240,9 @@ func runPython(ctx context.Context, job *Job) (err error) {
240
240
}
241
241
242
242
// Run
243
+ listenAddress := net .JoinHostPort (job .Host , job .Port )
243
244
if job .verbose {
244
- fmt .Printf ("PORT=%v ./.venv/bin/python ./service/main.py\n " , job .Port )
245
+ fmt .Printf ("PORT=%v LISTEN_ADDRESS=%v ./.venv/bin/python ./service/main.py\n " , job .Port , listenAddress )
245
246
}
246
247
cmd = exec .CommandContext (ctx , "./.venv/bin/python" , "./service/main.py" )
247
248
// cmd.Dir = job.Function.Root // handled by the middleware
@@ -254,7 +255,7 @@ func runPython(ctx context.Context, job *Job) (err error) {
254
255
// PWD environment variable for the subprocess to match Dir.
255
256
// The new method Cmd.Environ reports the environment that would be used
256
257
// to run the command, including the implicitly set PWD variable.
257
- cmd .Env = append (cmd .Env , "PORT=" + job .Port , "PWD=" + cmd .Dir )
258
+ cmd .Env = append (cmd .Env , "PORT=" + job .Port , "LISTEN_ADDRESS=" + listenAddress , " PWD="+ cmd .Dir )
258
259
259
260
// Running asynchronously allows for the client Run method to return
260
261
// metadata about the running function such as its chosen port.
You can’t perform that action at this time.
0 commit comments