1
0
Fork 0
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:
Matthias Hannig 2019-01-24 19:01:41 +01:00
parent 1ee6740688
commit 837c97da13

View file

@ -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 {