refactor(xsync): replace functional map with xsync.Map, remove functional/map

This commit is contained in:
yusing
2025-09-13 23:19:20 +08:00
parent 493c0afdfa
commit 0d2229cca0
5 changed files with 11 additions and 130 deletions

View File

@@ -3,10 +3,10 @@ package monitor
import (
"time"
F "github.com/yusing/go-proxy/internal/utils/functional"
"github.com/puzpuzpuz/xsync/v4"
)
var lastSeenMap = F.NewMapOf[string, time.Time]()
var lastSeenMap = xsync.NewMap[string, time.Time](xsync.WithPresize(50), xsync.WithGrowOnly())
func SetLastSeen(service string, lastSeen time.Time) {
lastSeenMap.Store(service, lastSeen)