ObservableTunnel: Don't cache configAsync

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-03-30 11:25:44 +05:30 committed by Jason A. Donenfeld
parent c547d033c3
commit 3095e19e13

View File

@ -71,10 +71,11 @@ class ObservableTunnel internal constructor(
}
private set
val configAsync: CompletionStage<Config> = if (config == null)
manager.getTunnelConfig(this)
else
CompletableFuture.completedFuture(config)
val configAsync: CompletionStage<Config>
get() = if (config == null)
manager.getTunnelConfig(this)
else
CompletableFuture.completedFuture(config)
fun setConfigAsync(config: Config): CompletionStage<Config> = if (config != this.config)
manager.setTunnelConfig(this, config)