diff --git a/docs/src/guides/jobs.md b/docs/src/guides/jobs.md index 60646c33c..56fdd147a 100644 --- a/docs/src/guides/jobs.md +++ b/docs/src/guides/jobs.md @@ -253,7 +253,9 @@ import JuliaHub # hide job = JuliaHub.submit_job( JuliaHub.script""" using Oxygen, HTTP - PORT = parse(Int, ENV["PORT"]) + # Environment variable name `PORT` was used in older JuliaHub environments + # and has been replaced with `JULIAHUB_APP_PORT` in newer environments + PORT = parse(Int, get(ENV, "JULIAHUB_APP_PORT", ENV["PORT"])) @get "/" function(req::HTTP.Request) return "success" end diff --git a/test/jobenvs/job-exposed-port/server.jl b/test/jobenvs/job-exposed-port/server.jl index d4d20836d..6c0186594 100644 --- a/test/jobenvs/job-exposed-port/server.jl +++ b/test/jobenvs/job-exposed-port/server.jl @@ -1,6 +1,8 @@ using Oxygen, HTTP -const PORT = parse(Int, ENV["PORT"]) +# Environment variable name `PORT` was used in older JuliaHub environments +# and has been replaced with `JULIAHUB_APP_PORT` in newer environments +const PORT = parse(Int, get(ENV, "JULIAHUB_APP_PORT", ENV["PORT"])) const NREQUESTS = Ref{Int}(0) function results_json()