Rewrite nasty code with if without else in elvis RHS
This commit is contained in:
+4
-2
@@ -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())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user