Skip to content

Commit

Permalink
feat(chore): optimize encoded cache value
Browse files Browse the repository at this point in the history
Signed-off-by: Mohammed Al Sahaf <[email protected]>
  • Loading branch information
mohammed90 committed Jul 25, 2024
1 parent fc2e175 commit cc41522
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ type CacheProvider struct {

const MappingKeyPrefix = "IDX_"

func DecodeMapping(item []byte) (mapping *StorageMapper, e error) {
e = proto.Unmarshal(item, mapping)
func DecodeMapping(item []byte) (*StorageMapper, error) {
mapping := &StorageMapper{}
e := proto.Unmarshal(item, mapping)

return
return mapping, e
}

func MappingElection(provider Storer, item []byte, req *http.Request, validator *Revalidator, logger *zap.Logger) (resultFresh *http.Response, resultStale *http.Response, e error) {
Expand Down

0 comments on commit cc41522

Please sign in to comment.