Clarify and clean up record key functions

This commit is contained in:
Daniel 2020-10-19 10:54:55 +02:00
parent ac1e00b0fe
commit 0d7e6dae96
3 changed files with 30 additions and 17 deletions

View file

@ -159,7 +159,11 @@ func (i *Interface) checkCache(key string) record.Record {
return nil
}
// updateCache updates an entry in the
// updateCache updates an entry in the interface cache. The given record may
// not be locked, as updating the cache might write an (unrelated) evicted
// record to the database in the process. If this happens while the
// DelayedCacheWriter flushes the write cache with the same record present,
// this will deadlock.
func (i *Interface) updateCache(r record.Record, write bool, remove bool, ttl int64) (written bool) {
// Check if cache is in use.
if i.cache == nil {