提交 a88b82d8 编写于 作者: M Mikhail Glukhikh

Rewrite nasty code with if without else in elvis RHS

上级 7a9315e6
...@@ -56,10 +56,12 @@ class CompileServiceClientSideImpl( ...@@ -56,10 +56,12 @@ class CompileServiceClientSideImpl(
while (keepAliveSuccess()) { while (keepAliveSuccess()) {
delay(KEEPALIVE_PERIOD - millisecondsSinceLastUsed()) delay(KEEPALIVE_PERIOD - millisecondsSinceLastUsed())
} }
runWithTimeout(timeout = KEEPALIVE_PERIOD / 2) { val keepAliveAcknowledgement = runWithTimeout(timeout = KEEPALIVE_PERIOD / 2) {
val id = sendMessage(keepAliveMessage) val id = sendMessage(keepAliveMessage)
readMessage<Server.KeepAliveAcknowledgement<*>>(id) readMessage<Server.KeepAliveAcknowledgement<*>>(id)
} ?: if (!keepAliveSuccess()) readActor.send(StopAllRequests()).also { }
if (keepAliveAcknowledgement == null && !keepAliveSuccess()) {
readActor.send(StopAllRequests())
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册