Skip to content

Commit 6c8f1a1

Browse files
authored
fix(test,doc): port env name change (#114)
Follow up from #113. That actually still had an issue, wherein the fallback was expecting a PORT env to be set, which would not be available in v2 environment.
1 parent 56cfb53 commit 6c8f1a1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/src/guides/jobs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ job = JuliaHub.submit_job(
255255
using Oxygen, HTTP
256256
# Environment variable name `PORT` was used in older JuliaHub environments
257257
# and has been replaced with `JULIAHUB_APP_PORT` in newer environments
258-
PORT = parse(Int, get(ENV, "JULIAHUB_APP_PORT", ENV["PORT"]))
258+
PORT = parse(Int, get(ENV, "JULIAHUB_APP_PORT", get(ENV, "PORT", "")))
259259
@get "/" function(req::HTTP.Request)
260260
return "success"
261261
end

test/jobenvs/job-exposed-port/server.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ using Oxygen, HTTP
22

33
# Environment variable name `PORT` was used in older JuliaHub environments
44
# and has been replaced with `JULIAHUB_APP_PORT` in newer environments
5-
const PORT = parse(Int, get(ENV, "JULIAHUB_APP_PORT", ENV["PORT"]))
5+
const PORT = parse(Int, get(ENV, "JULIAHUB_APP_PORT", get(ENV, "PORT", "")))
66
const NREQUESTS = Ref{Int}(0)
77

88
function results_json()

0 commit comments

Comments
 (0)