1
0
mirror of https://github.com/redis/go-redis.git synced 2025-08-08 23:42:06 +03:00

Refactor Tx using Pipeline to implement Cmdable interface.

This commit is contained in:
Vladimir Mihailenco
2016-10-13 14:36:15 +03:00
parent 3490ff5d21
commit 20bc3ec5a6
7 changed files with 52 additions and 69 deletions

View File

@@ -222,8 +222,8 @@ var _ = Describe("races", func() {
num, err := strconv.ParseInt(val, 10, 64)
Expect(err).NotTo(HaveOccurred())
cmds, err := tx.MultiExec(func() error {
tx.Set("key", strconv.FormatInt(num+1, 10), 0)
cmds, err := tx.Pipelined(func(pipe *redis.Pipeline) error {
pipe.Set("key", strconv.FormatInt(num+1, 10), 0)
return nil
})
Expect(cmds).To(HaveLen(1))