diff options
| -rw-r--r-- | storage/redis.go | 6 |
1 files changed, 5 insertions, 1 deletions
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 |
