Skip to content

Commit d48a7f9

Browse files
committed
cache: rlock row by model
Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
1 parent 46ff9a8 commit d48a7f9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cache/cache.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ func (r *RowCache) Row(uuid string) model.Model {
9090

9191
// RowByModel searches the cache using a the indexes for a provided model
9292
func (r *RowCache) RowByModel(m model.Model) model.Model {
93+
r.mutex.RLock()
94+
defer r.mutex.RUnlock()
9395
if reflect.TypeOf(m) != r.dataType {
9496
return nil
9597
}

0 commit comments

Comments
 (0)