Skip to content

Commit

Permalink
refactor: Improving memory allocation for redis
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Sep 17, 2022
1 parent feb08d5 commit 54d65af
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import (
"github.com/ViBiOh/httputils/v4/pkg/sha"
)

var cacheVersion = sha.New("vibioh/fibr/1")[:8]
var (
cacheVersion = sha.New("vibioh/fibr/1")[:8]
cachePrefix = "fibr:" + cacheVersion
)

func Redis(content string) string {
return fmt.Sprintf("fibr:%s:%s", cacheVersion, content)
return fmt.Sprintf("%s:%s", cachePrefix, content)
}

0 comments on commit 54d65af

Please sign in to comment.