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()
if err == redis.Nil {
return c.Status(404).Send(nil)
} else if err != nil {
// we shouldn't expect an error here, HMGet doesn't return one
if err != nil {
panic(err)
}
if settings[0] == nil {
return c.Status(404).Send(nil)
}
// value is compressed data, written is a timestamp
value, written := []byte(settings[0].(string)), settings[1].(string)