mirror of
https://github.com/safing/portbase
synced 2025-09-10 15:34:26 +00:00
Clarify and clean up record key functions
This commit is contained in:
parent
ac1e00b0fe
commit
0d7e6dae96
3 changed files with 30 additions and 17 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue