Skip to content

Commit

Permalink
fixed RequestCache
Browse files Browse the repository at this point in the history
  • Loading branch information
latolukasz committed Sep 10, 2021
1 parent f6bcd36 commit fda2aa4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions load_by_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,18 @@ func loadByID(serializer *serializer, engine *Engine, id uint64, entity Entity,
row, has := redisCache.Get(cacheKey)
if has {
if row == cacheNilValue {
if localCache != nil {
localCache.Set(cacheKey, cacheNilValue)
}
return false, schema
}
fillFromBinary(serializer, engine.registry, []byte(row), entity)
if len(references) > 0 {
warmUpReferences(serializer, engine, schema, orm.value, references, false)
}
if localCache != nil {
localCache.Set(cacheKey, orm.copyBinary())
}
return true, schema
}
}
Expand Down

0 comments on commit fda2aa4

Please sign in to comment.