mirror of
https://github.com/kalarina-bit/Sparkledns.git
synced 2026-11-22 07:36:09 +00:00
Remove an unused color and statistics reset
This commit is contained in:
@@ -46,7 +46,7 @@ object StatsStore {
|
||||
private val counters = Array(HOURS) { LongArray(FIELDS) }
|
||||
private var file: File? = null
|
||||
|
||||
// Bumped when the numbers change without a new query: loaded from disk or cleared
|
||||
// Bumped when the numbers change without a new query: loaded from disk
|
||||
private val _version = MutableStateFlow(0)
|
||||
val version: StateFlow<Int> = _version
|
||||
private var lastSave = 0L
|
||||
@@ -121,18 +121,6 @@ object StatsStore {
|
||||
}
|
||||
}
|
||||
|
||||
fun clear() {
|
||||
val snapshot = synchronized(this) {
|
||||
hourIds.fill(-1L)
|
||||
counters.forEach { it.fill(0L) }
|
||||
dirty = false
|
||||
lastSave = System.currentTimeMillis()
|
||||
if (file != null) encode() else null
|
||||
}
|
||||
snapshot?.let(::save)
|
||||
_version.value++
|
||||
}
|
||||
|
||||
// Saves what is not on disk yet; called when the VPN stops
|
||||
fun flush() {
|
||||
val snapshot = synchronized(this) {
|
||||
|
||||
Reference in New Issue
Block a user