MCPcopy
hub / github.com/fish2018/pansou / SetMemoryOnly

Method SetMemoryOnly

util/cache/enhanced_two_level_cache.go:65–72  ·  view source on GitHub ↗

SetMemoryOnly 仅更新内存缓存

(key string, data []byte, ttl time.Duration)

Source from the content-addressed store, hash-verified

63
64// SetMemoryOnly 仅更新内存缓存
65func (c *EnhancedTwoLevelCache) SetMemoryOnly(key string, data []byte, ttl time.Duration) error {
66 now := time.Now()
67
68 // 只更新内存缓存,不触发磁盘写入
69 c.memory.SetWithTimestamp(key, data, ttl, now)
70
71 return nil
72}
73
74// SetBothLevels 更新内存和磁盘缓存
75func (c *EnhancedTwoLevelCache) SetBothLevels(key string, data []byte, ttl time.Duration) error {

Callers 2

SetWithFinalFlagMethod · 0.95

Calls 1

SetWithTimestampMethod · 0.45

Tested by

no test coverage detected