refactor: remove unnecessary xsync.Map wrapper

- Updated agentPool, cachedAddr, fileContentMap, and lastSeenMap to use xsync.Map.
- Removed functional package and its related tests.
This commit is contained in:
yusing
2025-09-04 10:07:58 +08:00
parent 4a000316be
commit 97b6066466
10 changed files with 18 additions and 140 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)