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 private set
val configAsync: CompletionStage<Config> = if (config == null) val configAsync: CompletionStage<Config>
manager.getTunnelConfig(this) get() = if (config == null)
else manager.getTunnelConfig(this)
CompletableFuture.completedFuture(config) else
CompletableFuture.completedFuture(config)
fun setConfigAsync(config: Config): CompletionStage<Config> = if (config != this.config) fun setConfigAsync(config: Config): CompletionStage<Config> = if (config != this.config)
manager.setTunnelConfig(this, config) manager.setTunnelConfig(this, config)