diff --git a/src/main/scala/higherkindness/rules_scala/common/worker/WorkerMain.scala b/src/main/scala/higherkindness/rules_scala/common/worker/WorkerMain.scala index 8adf48ba..c88dbcce 100644 --- a/src/main/scala/higherkindness/rules_scala/common/worker/WorkerMain.scala +++ b/src/main/scala/higherkindness/rules_scala/common/worker/WorkerMain.scala @@ -145,6 +145,7 @@ abstract class WorkerMain[S](stdin: InputStream = System.in, stdout: PrintStream e.getCause() match { // Task successfully cancelled case cancelError: InterruptedException => + out.flush() writeResponse(requestId, None, None, wasCancelled = true) logVerbose( s"Cancellation WorkResponse sent for request id: $requestId in response to an" + @@ -165,6 +166,7 @@ abstract class WorkerMain[S](stdin: InputStream = System.in, stdout: PrintStream // Task successfully cancelled case Failure(e: CancellationException) => + out.flush() writeResponse(requestId, None, None, wasCancelled = true) logVerbose( s"Cancellation WorkResponse sent for request id: $requestId in response to a" +