ObservableTunnel: do not cache stats

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2020-03-28 15:58:12 -06:00
parent 07b69be7bf
commit 870b2bf36d

View File

@ -97,10 +97,11 @@ class ObservableTunnel internal constructor(
}
private set
val statisticsAsync: CompletionStage<Statistics> = if (statistics == null || statistics!!.isStale)
manager.getTunnelStatistics(this)
else
CompletableFuture.completedFuture(statistics)
val statisticsAsync: CompletionStage<Statistics>
get() = if (statistics == null || statistics!!.isStale)
manager.getTunnelStatistics(this)
else
CompletableFuture.completedFuture(statistics)
fun onStatisticsChanged(statistics: Statistics?): Statistics? {
this.statistics = statistics