IncreaseHit 增加点击量
(hash string)
| 383 | |
| 384 | // IncreaseHit 增加点击量 |
| 385 | func (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 | |
| 403 | func (this *MemoryList) Prefixes() []string { |
| 404 | return this.prefixes |
nothing calls this directly
no test coverage detected