Skip to content

Commit

Permalink
Update objects with transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcook committed Nov 17, 2023
1 parent d9bac62 commit 2d7da4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ func (testHook) ProcessPipelineHook(next redis.ProcessPipelineHook) redis.Proces
}

for _, cmd := range cmds {
keys[cmd.Args()[1].(string)] = true
if len(cmd.Args()) >= 2 {
keys[cmd.Args()[1].(string)] = true
}
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion update.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func updateInternal(id string, ptr interface{}, opts *UpdateOptions) error {
pip := opts.Pipeline

if opts.Pipeline == nil {
pip = C.Pipeline()
pip = C.TxPipeline()
}

for i := 0; i < typ.NumField(); i++ {
Expand Down

0 comments on commit 2d7da4d

Please sign in to comment.