(ip string, s *model.Sharing)
| 618 | ) |
| 619 | |
| 620 | func 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 | } |
no test coverage detected