MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / countAccess

Function countAccess

server/handles/sharing.go:620–629  ·  view source on GitHub ↗
(ip string, s *model.Sharing)

Source from the content-addressed store, hash-verified

618)
619
620func countAccess(ip string, s *model.Sharing) error {
621 key := fmt.Sprintf("%s:%s", s.ID, ip)
622 _, ok := AccessCache.Get(key)
623 if !ok {
624 AccessCache.Set(key, struct{}{}, cache.WithEx[interface{}](AccessCountDelay))
625 s.Accessed += 1
626 return op.UpdateSharing(s, true)
627 }
628 return nil
629}

Callers 5

SharingGetFunction · 0.85
SharingListFunction · 0.85
SharingArchiveMetaFunction · 0.85
SharingArchiveListFunction · 0.85
SharingDownFunction · 0.85

Calls 3

UpdateSharingFunction · 0.92
GetMethod · 0.65
SetMethod · 0.45

Tested by

no test coverage detected