From 01b7c7b4cfa51893f749b08156732d17e049adbb Mon Sep 17 00:00:00 2001 From: Khosrow Afroozeh Date: Fri, 15 May 2015 10:39:00 +0200 Subject: [PATCH] fixed setting TaskIds on the client --- CHANGELOG.md | 2 ++ statement.go | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4ff7742..24c640db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ * Fixed minor bugs regarding handling of nulls in structs for `GetObj()` and `PutObj()`. + * Fixed a bug regarding setting TaskIds on the client. + * ** Other Changes ** * Removed deprecated `ReplaceRoles()` method. diff --git a/statement.go b/statement.go index f7bee937..a1631a43 100644 --- a/statement.go +++ b/statement.go @@ -15,6 +15,8 @@ package aerospike import ( + "math" + xornd "github.com/aerospike/aerospike-client-go/types/rand" ) @@ -87,6 +89,6 @@ func (stmt *Statement) IsScan() bool { // Always set the taskId client-side to a non-zero random value func (stmt *Statement) setTaskId() { for stmt.TaskId == 0 { - stmt.TaskId = xornd.Int64() + stmt.TaskId = int64(math.Abs(float64(xornd.Int64()))) } }