do not generate unique id on background submission

This commit is contained in:
Ingo Oeser 2013-02-18 19:50:14 +01:00
parent 6619b9a10e
commit af4035284d

View File

@ -283,8 +283,7 @@ func (client *Client) writeJob(job *Job) {
// Internal do // Internal do
func (client *Client) do(funcname string, data []byte, func (client *Client) do(funcname string, data []byte,
flag uint32) (id string, handle string) { flag uint32, id string) (handle string) {
id = strconv.Itoa(int(ai.Id()))
l := len(funcname) + len(id) + len(data) + 2 l := len(funcname) + len(id) + len(data) + 2
rel := make([]byte, 0, l) rel := make([]byte, 0, l)
rel = append(rel, []byte(funcname)...) // len(funcname) rel = append(rel, []byte(funcname)...) // len(funcname)
@ -317,8 +316,8 @@ flag byte, jobhandler JobHandler) (handle string) {
default: default:
datatype = common.SUBMIT_JOB datatype = common.SUBMIT_JOB
} }
var id string id := strconv.Itoa(int(ai.Id()))
id, handle = client.do(funcname, data, datatype) handle = client.do(funcname, data, datatype, id)
if jobhandler != nil { if jobhandler != nil {
client.jobhandlers[id] = jobhandler client.jobhandlers[id] = jobhandler
} }
@ -336,7 +335,7 @@ flag byte) (handle string) {
default: default:
datatype = common.SUBMIT_JOB_BG datatype = common.SUBMIT_JOB_BG
} }
_, handle = client.do(funcname, data, datatype) handle = client.do(funcname, data, datatype, "")
return return
} }