fix type error
Some checks are pending
Go / build (push) Waiting to run

This commit is contained in:
mojocn
2025-01-17 11:58:28 +08:00
parent 1592721fd7
commit d1ebf60fa6

View File

@@ -9,7 +9,6 @@ import (
"github.com/unchainese/unchain/internal/global"
"log"
"log/slog"
"math"
"net/http"
"os"
"runtime"
@@ -107,12 +106,17 @@ func (app *App) loopPush() {
}
func (app *App) trafficInc(uid string, byteN int64) {
kbInt64 := int64(math.Ceil(float64(byteN) / float64(1024)))
kb := byteN >> 10
value, ok := app.trafficUserKB.Load(uid)
if ok {
kbInt64 += value.(int64)
iv, isInt64 := value.(int64)
if isInt64 {
kb += iv
} else {
slog.Error("not a int64", "uid", uid, "value", value)
}
}
app.trafficUserKB.Store(uid, kbInt64)
app.trafficUserKB.Store(uid, kb)
}
func (app *App) stat() *AppStat {