MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / IncreaseHit

Method IncreaseHit

internal/caches/list_memory.go:385–401  ·  view source on GitHub ↗

IncreaseHit 增加点击量

(hash string)

Source from the content-addressed store, hash-verified

383
384// IncreaseHit 增加点击量
385func (this *MemoryList) IncreaseHit(hash string) error {
386 this.locker.Lock()
387
388 itemMap, ok := this.itemMaps[this.prefix(hash)]
389 if !ok {
390 this.locker.Unlock()
391 return nil
392 }
393
394 item, ok := itemMap[hash]
395 if ok {
396 item.Week = currentWeek()
397 }
398
399 this.locker.Unlock()
400 return nil
401}
402
403func (this *MemoryList) Prefixes() []string {
404 return this.prefixes

Callers

nothing calls this directly

Calls 4

prefixMethod · 0.95
currentWeekFunction · 0.85
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected