From 95911100823b5c809225d664de74ad2d64e91972 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Thu, 22 Dec 2022 23:19:31 +0100 Subject: cache: fix some bugs after refactor --- cache/cached.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cache/cached.go') diff --git a/cache/cached.go b/cache/cached.go index ce1d6637..9f9e170d 100644 --- a/cache/cached.go +++ b/cache/cached.go @@ -9,6 +9,8 @@ import ( "github.com/MichaelMure/git-bug/util/lamport" ) +var _ CacheEntity = &CachedEntityBase[dag.Snapshot, dag.Operation]{} + // CachedEntityBase provide the base function of an entity managed by the cache. type CachedEntityBase[SnapT dag.Snapshot, OpT dag.Operation] struct { repo repository.ClockedRepo @@ -92,6 +94,10 @@ func (e *CachedEntityBase[SnapT, OpT]) NeedCommit() bool { return e.entity.NeedCommit() } +func (e *CachedEntityBase[SnapT, OpT]) Lock() { + e.mu.Lock() +} + func (e *CachedEntityBase[SnapT, OpT]) CreateLamportTime() lamport.Time { return e.entity.CreateLamportTime() } -- cgit