Skip to content

Commit

Permalink
Revert "fix CPGQLServerTests: only read a line if there is something …
Browse files Browse the repository at this point in the history
…to read"

This reverts commit 143227265e556071bc4e1dc08e3bae8ee91a8930.
  • Loading branch information
mpollmeier committed May 18, 2021
1 parent a7e1261 commit a1928e4
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class UserRunnable(queue: BlockingQueue[Job], writer: PrintWriter, reader: Buffe
terminate = true
} else {
sendQueryToAmmonite(job)
stdOutUpToMarker().map { stdOutput =>
val errOutput = exhaustStderr()
val result = new QueryResult(stdOutput, errOutput, job.uuid)
job.observer(result)
}
val stdoutPair = stdOutUpToMarker()
val stdOutput = stdoutPair.get
val errOutput = exhaustStderr()
val result = new QueryResult(stdOutput, errOutput, job.uuid)
job.observer(result)
}
}
} catch {
Expand All @@ -51,10 +51,7 @@ class UserRunnable(queue: BlockingQueue[Job], writer: PrintWriter, reader: Buffe

private def stdOutUpToMarker(): Option[String] = {
var currentOutput: String = ""
var line =
if (reader.ready) reader.readLine()
else null

var line = reader.readLine()
while (line != null) {
if (!line.startsWith(magicEchoSeq) && !line.isEmpty) {
val uuid = uuidFromLine(line)
Expand Down

0 comments on commit a1928e4

Please sign in to comment.