Merge branch 'main' into issue-64

This commit is contained in:
Kelvin Mwinuka
2024-06-25 14:30:14 +08:00
3 changed files with 1286 additions and 11242 deletions

View File

@@ -499,13 +499,11 @@ func (server *EchoVault) IncrBy(key string, value string) (int, error) {
func (server *EchoVault) DecrBy(key string, value string) (int, error) {
// Construct the command
cmd := []string{"DECRBY", key, value}
// Execute the command
b, err := server.handleCommand(server.context, internal.EncodeCommand(cmd), nil, false, true)
if err != nil {
return 0, err
}
// Parse the integer response
return internal.ParseIntegerResponse(b)
}