Function
metaIncrement
(file *WaveFile, key string, amount int)
Source from the content-addressed store, hash-verified
| 281 | } |
| 282 | |
| 283 | func metaIncrement(file *WaveFile, key string, amount int) int { |
| 284 | if file.Meta == nil { |
| 285 | file.Meta = make(wshrpc.FileMeta) |
| 286 | } |
| 287 | val, ok := file.Meta[key].(int) |
| 288 | if !ok { |
| 289 | val = 0 |
| 290 | } |
| 291 | newVal := val + amount |
| 292 | file.Meta[key] = newVal |
| 293 | return newVal |
| 294 | } |
| 295 | |
| 296 | func (s *FileStore) compactIJson(ctx context.Context, entry *CacheEntry) error { |
| 297 | // we don't need to lock the entry because we have the lock on the filestore |
Tested by
no test coverage detected