From 6cb3313793bf45e197b3048f0abd2f600bf97bb5 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 12 Jul 2026 15:00:16 +0200 Subject: multi exec and discard --- pkg/commands/discard.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 pkg/commands/discard.go (limited to 'pkg/commands/discard.go') diff --git a/pkg/commands/discard.go b/pkg/commands/discard.go new file mode 100644 index 0000000..e96d2c0 --- /dev/null +++ b/pkg/commands/discard.go @@ -0,0 +1,18 @@ +package commands + +import ( + "errors" + "net" + "redisClone/pkg/core" +) + +func Discard(db core.RedisDB, session *ClientSession, conn net.Conn, execArgs []string) interface{} { + if !session.InTransaction { + return errors.New("DISCARD without MULTI") + } + + session.InTransaction = false + session.Queue = nil + + return core.SimpleString("OK") +} -- cgit v1.2.3