Skip to content

Commit

Permalink
Avoid error in Daemon by finishing the task before the output is done.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmolina committed May 27, 2021
1 parent 21a58d5 commit bb7b803
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/DaemonMode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -319,17 +319,24 @@ function serverRun(run, sock, shared, print_stack, fname, args)
rethrow(e)
end
end
# If there is missing message I write it
text = String(take!(out))
try
# If there is missing message I write it
text = String(take!(out))

if !isempty(text)
print(sock, text)
if !isempty(text)
print(sock, text)
end
# Ignore possible error in output by finishing
catch e
end
# If # TODO: here is missing message I write it
text = String(take!(err))
try
text = String(take!(err))

if !isempty(text)
print(sock, text)
if !isempty(text)
print(sock, text)
end
# Ignore possible error in error by finishing
catch e
end
end
end
Expand Down

0 comments on commit bb7b803

Please sign in to comment.