MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / Stop

Method Stop

internal/caches/storage_memory.go:331–358  ·  view source on GitHub ↗

Stop 停止缓存策略

()

Source from the content-addressed store, hash-verified

329
330// Stop 停止缓存策略
331func (this *MemoryStorage) Stop() {
332 this.locker.Lock()
333
334 this.valuesMap = map[uint64]*MemoryItem{}
335 this.writingKeyMap = map[string]zero.Zero{}
336 _ = this.list.Reset()
337 if this.purgeTicker != nil {
338 this.purgeTicker.Stop()
339 }
340
341 if this.dirtyChan != nil {
342 close(this.dirtyChan)
343 }
344
345 this.usedSize = 0
346 this.totalDirtySize = 0
347
348 _ = this.list.Close()
349
350 this.locker.Unlock()
351
352 this.ignoreKeys.Reset()
353
354 // 回收内存
355 runtime.GC()
356
357 remotelogs.Println("CACHE", "close memory storage '"+strconv.FormatInt(this.policy.Id, 10)+"'")
358}
359
360// Policy 获取当前存储的Policy
361func (this *MemoryStorage) Policy() *serverconfigs.HTTPCachePolicy {

Callers

nothing calls this directly

Calls 7

PrintlnFunction · 0.92
ResetMethod · 0.65
StopMethod · 0.65
CloseMethod · 0.65
GCMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected