aboutsummaryrefslogtreecommitdiff
path: root/handlers.go
diff options
context:
space:
mode:
authoralex <[email protected]>2026-07-08 21:11:52 +0200
committeralex <[email protected]>2026-07-08 21:11:52 +0200
commit917b08a98cb310d05170d2ef3de9847419e3990e (patch)
treed2c797c86ea23beb8e6926239070ff2391d6edd4 /handlers.go
parentaac1dd50b61090461cefc0263f065140be4bf50b (diff)
downloadredis-clone-917b08a98cb310d05170d2ef3de9847419e3990e.tar.xz
redis-clone-917b08a98cb310d05170d2ef3de9847419e3990e.zip
fixed bug regarding DEL
Diffstat (limited to 'handlers.go')
-rw-r--r--handlers.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/handlers.go b/handlers.go
index 980e805..b4668f8 100644
--- a/handlers.go
+++ b/handlers.go
@@ -82,12 +82,12 @@ func handleDel(conn net.Conn, args []string) {
conn.Write(serializeRESP(err))
return
}
- keys := args[:1]
+ keys := args[1:]
deletedKeys := db.ExecuteMulti(keys, func(shards []*Shard) interface{}{
count := 0
for _, key := range keys{
shard := db.getShard(key)
- _, exists := shard.data[key]
+ _, exists := shard.data[key]
if exists {
delete(shard.data, key)
count += 1