P0 fixes: - ModelError.Is(): use exact matching instead of substring contains() - shouldClearStickySession: add context param for cancellation/tracing P1 fixes: - TODO stubs: return 501 Not Implemented errors - validateInstanceSignature: deduplicate to shared validateCodeSignature() - Error messages: standardize to English only - http.go: remove pseudo if-else with duplicate branches
26 lines
512 B
Go
26 lines
512 B
Go
package admin
|
|
|
|
import (
|
|
"strconv"
|
|
"strings"
|
|
"time"
|
|
)
|
|
|
|
var accountTodayStatsBatchCache = newSnapshotCache(30 * time.Second)
|
|
|
|
func buildAccountTodayStatsBatchCacheKey(accountIDs []int64) string {
|
|
if len(accountIDs) == 0 {
|
|
return "accounts_today_stats_empty"
|
|
}
|
|
var b strings.Builder
|
|
b.Grow(len(accountIDs) * 6)
|
|
_, _ = b.WriteString("accounts_today_stats:")
|
|
for i, id := range accountIDs {
|
|
if i > 0 {
|
|
_ = b.WriteByte(',')
|
|
}
|
|
_, _ = b.WriteString(strconv.FormatInt(id, 10))
|
|
}
|
|
return b.String()
|
|
}
|