fix GET
This commit is contained in:
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user