Skip to content

Commit 0e27d3d

Browse files
committed
remove status info code that is now printed by server on julia side
1 parent 9e94e8d commit 0e27d3d

File tree

1 file changed

+1
-42
lines changed

1 file changed

+1
-42
lines changed

src/resources/julia/quartonotebookrunner.jl

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ using Dates: now
3737

3838
using QuartoNotebookRunner
3939
using Sockets
40-
using Pkg
41-
using TOML
4240

4341
transport_file = ARGS[1]
4442
transport_dir = dirname(transport_file)
@@ -50,47 +48,8 @@ end
5048
server = QuartoNotebookRunner.serve(; timeout = 300)
5149
port = server.port
5250

53-
const JSONDict = Dict{String,Union{Int,String,Float64}}
54-
55-
function json_string(d::JSONDict)
56-
iob = IOBuffer()
57-
print(iob, "{")
58-
for (i, (key, value)) in enumerate(d)
59-
i > 1 && print(iob, ",")
60-
show(iob, key)
61-
print(iob, ":")
62-
show(iob, value)
63-
end
64-
print(iob, "}")
65-
return String(take!(iob))
66-
end
67-
68-
active_project_file = Base.active_project()
69-
active_project_dir = dirname(active_project_file)
70-
if active_project_dir == transport_dir
71-
active_project_dir = "quarto internal"
72-
end
73-
74-
qnr_uuid = "4c0109c6-14e9-4c88-93f0-2b974d3468f4"
75-
active_project_file_parsed = TOML.parsefile(active_project_file)
76-
# the Pkg.dependencies way doesn't work if the env is QuartoNotebookRunner itself
77-
qnr_version = if get(active_project_file_parsed, "uuid", "") == qnr_uuid
78-
active_project_file_parsed["version"]::String
79-
else
80-
string(Pkg.dependencies()[Base.UUID(qnr_uuid)].version)
81-
end
82-
83-
json = json_string(JSONDict([
84-
"port" => Int64(port),
85-
"pid" => Int64(Base.Libc.getpid()),
86-
"key" => string(server.key),
87-
"juliaVersion" => string(VERSION),
88-
"environment" => active_project_dir,
89-
"runnerVersion" => qnr_version,
90-
]))
91-
9251
open(transport_file, "w") do io
93-
println(io, json)
52+
println(io, """{"port": $port, "pid": $(Base.Libc.getpid()), "key": "$(server.key)"}""")
9453
end
9554

9655
@info "Starting server at $(now())"

0 commit comments

Comments
 (0)