You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Fatalf("Received an error while preparing for MULTI: %v, error: %v", cmd, err)
70
+
}
71
+
72
+
// If any of the calls after the MULTI call error it's important that
73
+
// the transaction is discarded. This isn't strictly necessary if the
74
+
// only possible error is a network error, as the connection would be
75
+
// closed by the client anyway.
76
+
varerrerror
77
+
deferfunc() {
78
+
iferr!=nil {
79
+
// The return from DISCARD doesn't matter. If it's an error then
80
+
// it's a network error and the Conn will be closed by the
81
+
// client.
82
+
conn.Do(radix.Cmd(nil, "DISCARD"))
83
+
log.Fatalf("Received an error while in multi: %v, error: %v", cmd, err)
84
+
}
85
+
}()
86
+
87
+
// queue up the transaction's commands
88
+
err=conn.Do(cmd)
89
+
90
+
// execute the transaction, capturing the result in a Tuple. We only
91
+
// care about the first element (the result from GET), so we discard the
92
+
// second by setting nil.
93
+
returnconn.Do(radix.Cmd(nil, "EXEC"))
94
+
}))
95
+
} else {
96
+
err=conn.Do(cmd)
97
+
}
63
98
endT:=time.Now()
64
99
iferr!=nil {
65
100
ifcontinueOnError {
@@ -90,6 +125,7 @@ func main() {
90
125
datasize:=flag.Uint64("d", 3, "Data size of the expanded string __data__ value in bytes. The benchmark will expand the string __data__ inside an argument with a charset with length specified by this parameter. The substitution changes every time a command is executed.")
91
126
numberRequests:=flag.Uint64("n", 10000000, "Total number of requests")
0 commit comments