- stats: if "SET" to zero, stat is removed

This commit is contained in:
bloved 2021-01-14 00:20:23 +01:00
parent 945709f24e
commit 15ec9f49ac
1 changed files with 6 additions and 1 deletions

View File

@ -81,7 +81,12 @@ func statsThread() {
case "INC": case "INC":
ZabovStats[item.Payload] += item.Number ZabovStats[item.Payload] += item.Number
case "SET": case "SET":
ZabovStats[item.Payload] = item.Number if item.Number == 0 {
delete(ZabovStats, item.Payload)
} else {
ZabovStats[item.Payload] = item.Number
}
case "PRI": case "PRI":
statsPrint() statsPrint()
} }