Browse Source

ObservableTunnel: do not cache stats

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
master
Jason A. Donenfeld 4 years ago
parent
commit
870b2bf36d
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      ui/src/main/java/com/wireguard/android/model/ObservableTunnel.kt

+ 5
- 4
ui/src/main/java/com/wireguard/android/model/ObservableTunnel.kt 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


Loading…
Cancel
Save