This commit is contained in:
Lewis Crichton
2023-02-20 23:19:11 +00:00
parent aaeb4306c8
commit d4ce5814fc
+6 -3
View File
@@ -131,12 +131,15 @@ func main() {
settings, err := rdb.HMGet(c.Context(), "settings:" + hash(PEPPER_SETTINGS + userId), "value", "written").Result() settings, err := rdb.HMGet(c.Context(), "settings:" + hash(PEPPER_SETTINGS + userId), "value", "written").Result()
if err == redis.Nil { // we shouldn't expect an error here, HMGet doesn't return one
return c.Status(404).Send(nil) if err != nil {
} else if err != nil {
panic(err) panic(err)
} }
if settings[0] == nil {
return c.Status(404).Send(nil)
}
// value is compressed data, written is a timestamp // value is compressed data, written is a timestamp
value, written := []byte(settings[0].(string)), settings[1].(string) value, written := []byte(settings[0].(string)), settings[1].(string)