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

Method Discard

internal/caches/writer_memory.go:161–171  ·  view source on GitHub ↗

Discard 丢弃

()

Source from the content-addressed store, hash-verified

159
160// Discard 丢弃
161func (this *MemoryWriter) Discard() error {
162 // 需要在Locker之外
163 defer this.once.Do(func() {
164 this.endFunc(this.item)
165 })
166
167 this.storage.locker.Lock()
168 delete(this.storage.valuesMap, this.hash)
169 this.storage.locker.Unlock()
170 return nil
171}
172
173// Key 获取Key
174func (this *MemoryWriter) Key() string {

Callers

nothing calls this directly

Calls 3

DoMethod · 0.80
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected