Merge pull request #15 from paulmach/master
Update and Receive status correctly
This commit is contained in:
commit
2107c9b883
@ -265,14 +265,14 @@ func (client *Client) handleStatus(job *Job) {
|
|||||||
status.Known = (data[1][0] == '1')
|
status.Known = (data[1][0] == '1')
|
||||||
status.Running = (data[2][0] == '1')
|
status.Running = (data[2][0] == '1')
|
||||||
var err error
|
var err error
|
||||||
status.Numerator, err = strconv.ParseUint(string(data[3][0]), 10, 0)
|
status.Numerator, err = strconv.ParseUint(string(data[3]), 10, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
client.err(common.Errorf("Invalid handle: %s", data[3][0]))
|
client.err(common.Errorf("Invalid Integer: %s", data[3]))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
status.Denominator, err = strconv.ParseUint(string(data[4][0]), 10, 0)
|
status.Denominator, err = strconv.ParseUint(string(data[4]), 10, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
client.err(common.Errorf("Invalid handle: %s", data[4][0]))
|
client.err(common.Errorf("Invalid Integer: %s", data[4]))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
client.status <- status
|
client.status <- status
|
||||||
|
@ -112,6 +112,7 @@ func (job *Job) UpdateStatus(numerator, denominator int) {
|
|||||||
d := []byte(strconv.Itoa(denominator))
|
d := []byte(strconv.Itoa(denominator))
|
||||||
result := append([]byte(job.Handle), 0)
|
result := append([]byte(job.Handle), 0)
|
||||||
result = append(result, n...)
|
result = append(result, n...)
|
||||||
|
result = append(result, '\x00')
|
||||||
result = append(result, d...)
|
result = append(result, d...)
|
||||||
job.agent.WriteJob(newJob(common.REQ, common.WORK_STATUS, result))
|
job.agent.WriteJob(newJob(common.REQ, common.WORK_STATUS, result))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user