Repository: redis/rueidis

Issue:
Update `commands.json` to support the new `DIFF`, `DIFF1`, `ANDOR`, and `ONE` options for `BITOP`
We need to update `commands.json` and run [go generate](https://github.com/redis/rueidis?tab=readme-ov-file#generate-command-builders) to update the command builder for the new `DIFF`, `DIFF1`, `ANDOR`, and `ONE` options for `BITOP`.

See https://github.com/redis/redis/pull/13898.

Discussion:

Solution patch:
diff --git a/hack/cmds/commands.json b/hack/cmds/commands.json
index e35fb7e..bc38121 100644
--- a/hack/cmds/commands.json
+++ b/hack/cmds/commands.json
@@ -363,7 +363,11 @@
           "AND",
           "OR",
           "XOR",
-          "NOT"
+          "NOT",
+          "DIFF",
+          "DIFF1",
+          "ANDOR",
+          "ONE"
         ]
       },
       {
diff --git a/internal/cmds/gen_bitmap.go b/internal/cmds/gen_bitmap.go
index e62efa1..4be2fdb 100644
--- a/internal/cmds/gen_bitmap.go
+++ b/internal/cmds/gen_bitmap.go
@@ -373,6 +373,26 @@ func (c Bitop) Not() BitopOperationNot {
 	return (BitopOperationNot)(c)
 }
 
+func (c Bitop) Diff() BitopOperationDiff {
+	c.cs.s = append(c.cs.s, "DIFF")
+	return (BitopOperationDiff)(c)
+}
+
+func (c Bitop) Diff1() BitopOperationDiff1 {
+	c.cs.s = append(c.cs.s, "DIFF1")
+	return (BitopOperationDiff1)(c)
+}
+
+func (c Bitop) Andor() BitopOperationAndor {
+	c.cs.s = append(c.cs.s, "ANDOR")
+	return (BitopOperationAndor)(c)
+}
+
+func (c Bitop) One() BitopOperationOne {
+	c.cs.s = append(c.cs.s, "ONE")
+	return (BitopOperationOne)(c)
+}
+
 type BitopDestkey Incomplete
 
 func (c BitopDestkey) Key(key ...string) BitopKey {
@@ -424,6 +444,42 @@ func (c BitopOperationAnd) Destkey(destkey string) BitopDestkey {
 	return (BitopDestkey)(c)
 }
 
+type BitopOperationAndor Incomplete
+
+func (c BitopOperationAndor) Destkey(destkey string) BitopDestkey {
+	if c.ks&NoSlot == NoSlot {
+		c.ks = NoSlot | slot(destkey)
+	} else {
+		c.ks = check(c.ks, slot(destkey))
+	}
+	c.cs.s = append(c.cs.s, destkey)
+	return (BitopDestkey)(c)
+}
+
+type BitopOperationDiff Incomplete
+
+func (c BitopOperationDiff) Destkey(destkey string) BitopDestkey {
+	if c.ks&NoSlot == NoSlot {
+		c.ks = NoSlot | slot(destkey)
+	} else {
+		c.ks = check(c.ks, slot(destkey))
+	}
+	c.cs.s = append(c.cs.s, destkey)
+	return (BitopDestkey)(c)
+}
+
+type BitopOperationDiff1 Incomplete
+
+func (c BitopOperationDiff1) Destkey(destkey string) BitopDestkey {
+	if c.ks&NoSlot == NoSlot {
+		c.ks = NoSlot | slot(destkey)
+	} else {
+		c.ks = check(c.ks, slot(destkey))
+	}
+	c.cs.s = append(c.cs.s, destkey)
+	return (BitopDestkey)(c)
+}
+
 type BitopOperationNot Incomplete
 
 func (c BitopOperationNot) Destkey(destkey string) BitopDestkey {
@@ -436,6 +492,18 @@ func (c BitopOperationNot) Destkey(destkey string) BitopDestkey {
 	return (BitopDestkey)(c)
 }
 
+type BitopOperationOne Incomplete
+
+func (c BitopOperationOne) Destkey(destkey string) BitopDestkey {
+	if c.ks&NoSlot == NoSlot {
+		c.ks = NoSlot | slot(destkey)
+	} else {
+		c.ks = check(c.ks, slot(destkey))
+	}
+	c.cs.s = append(c.cs.s, destkey)
+	return (BitopDestkey)(c)
+}
+
 type BitopOperationOr Incomplete
 
 func (c BitopOperationOr) Destkey(destkey string) BitopDestkey {
diff --git a/rueidislock/lock.go b/rueidislock/lock.go
index e53d8d5..dfc6c39 100644
--- a/rueidislock/lock.go
+++ b/rueidislock/lock.go
@@ -24,7 +24,7 @@ type LockerOption struct {
 	ClientOption rueidis.ClientOption
 	// KeyValidity is the validity duration of locks and will be extended periodically by the ExtendInterval. The default value is 5s.
 	KeyValidity time.Duration
-	// ExtendInterval is the interval to extend KeyValidity. Default value is 1s.
+	// ExtendInterval is the interval to extend KeyValidity. Default value is 1/2 of KeyValidity.
 	ExtendInterval time.Duration
 	// TryNextAfter is the timeout duration before trying the next redis key for locks. The default value is 20ms.
 	TryNextAfter time.Duration



Test patch:
diff --git a/internal/cmds/gen_bitmap_test.go b/internal/cmds/gen_bitmap_test.go
index df17ee2..985bc8f 100644
--- a/internal/cmds/gen_bitmap_test.go
+++ b/internal/cmds/gen_bitmap_test.go
@@ -38,6 +38,10 @@ func bitmap0(s Builder) {
 	s.Bitop().Or().Destkey("1").Key("1").Key("1").Build()
 	s.Bitop().Xor().Destkey("1").Key("1").Key("1").Build()
 	s.Bitop().Not().Destkey("1").Key("1").Key("1").Build()
+	s.Bitop().Diff().Destkey("1").Key("1").Key("1").Build()
+	s.Bitop().Diff1().Destkey("1").Key("1").Key("1").Build()
+	s.Bitop().Andor().Destkey("1").Key("1").Key("1").Build()
+	s.Bitop().One().Destkey("1").Key("1").Key("1").Build()
 	s.Bitpos().Key("1").Bit(1).Start(1).End(1).Byte().Build()
 	s.Bitpos().Key("1").Bit(1).Start(1).End(1).Byte().Cache()
 	s.Bitpos().Key("1").Bit(1).Start(1).End(1).Bit().Build()