summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChloe Kudryavtsev <toast@toast.cafe>2019-12-17 13:57:02 -0500
committerChloe Kudryavtsev <toast@toast.cafe>2019-12-17 13:57:02 -0500
commitf5ddd2db471456c32bfd2eb4ab589e194fb3d901 (patch)
tree597e447a474726e627287097c16848970f2278a6
parentfix: update dummy backend and tests for NotFound (diff)
fix: update redis backend to return NotFound
-rw-r--r--storage/redis.go6
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