mirror of
https://github.com/alice-lg/birdwatcher.git
synced 2025-03-09 00:00:05 +01:00
prefix cache key for use with birdc and birdc6
This commit is contained in:
parent
1ee6740688
commit
837c97da13
1 changed files with 2 additions and 0 deletions
|
@ -52,6 +52,7 @@ func fromCacheMemory(key string) (Parsed, bool) {
|
|||
}
|
||||
|
||||
func fromCacheRedis(key string) (Parsed, bool) {
|
||||
key = "B" + IPVersion + "_" + key
|
||||
val, err := CacheRedis.Get(key)
|
||||
if err != nil {
|
||||
return NilParse, false
|
||||
|
@ -81,6 +82,7 @@ func toCacheMemory(key string, val Parsed) {
|
|||
}
|
||||
|
||||
func toCacheRedis(key string, val Parsed) {
|
||||
key = "B" + IPVersion + "_" + key
|
||||
val["ttl"] = time.Now().Add(5 * time.Minute)
|
||||
err := CacheRedis.Set(key, val)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue