Merge pull request #254 from rshura/fset_maxmemory

Add maxmemory protection to FSET
This commit is contained in:
Josh Baker 2018-01-30 11:17:13 -07:00 committed by GitHub
commit 2088b5d2d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -824,6 +824,10 @@ func (c *Controller) parseFSetArgs(vs []resp.Value) (
} }
func (c *Controller) cmdFset(msg *server.Message) (res resp.Value, d commandDetailsT, err error) { func (c *Controller) cmdFset(msg *server.Message) (res resp.Value, d commandDetailsT, err error) {
if c.config.maxMemory() > 0 && c.outOfMemory.on() {
err = errOOM
return
}
start := time.Now() start := time.Now()
vs := msg.Values[1:] vs := msg.Values[1:]
var fields []string var fields []string