SetMemoryOnly 仅更新内存缓存
(key string, data []byte, ttl time.Duration)
| 63 | |
| 64 | // SetMemoryOnly 仅更新内存缓存 |
| 65 | func (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 更新内存和磁盘缓存 |
| 75 | func (c *EnhancedTwoLevelCache) SetBothLevels(key string, data []byte, ttl time.Duration) error { |
no test coverage detected