From f5ddd2db471456c32bfd2eb4ab589e194fb3d901 Mon Sep 17 00:00:00 2001 From: Chloe Kudryavtsev Date: Tue, 17 Dec 2019 13:57:02 -0500 Subject: fix: update redis backend to return NotFound --- storage/redis.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/storage/redis.go b/storage/redis.go index 317ee3e..a6680b5 100644 --- a/storage/redis.go +++ b/storage/redis.go @@ -29,7 +29,11 @@ func (r *Redis) Read(key string) (string, error) { if !r.Healthy() { return "", Unhealthy } - return r.Get(key).Result() // TODO: return NotFound conditionally + res, err := r.Get(key).Result() + if err == redis.Nil { + return res, NotFound + } + return res, err } // Healthy determines whether redis is responding to pings -- cgit v1.2.3