fixes for job shop main slaves

This commit is contained in:
shoopea 2020-02-07 10:55:46 +08:00
parent 38fdbb8c32
commit c5dddf20f0

8
job.go
View File

@ -2248,7 +2248,7 @@ func jobShopsSlave(j Job) {
b2 := getJobPayloadUnsafe(p.JobCallbackID64)
var p2 JobPayloadShops
err = json.Unmarshal(b2, &p2)
p2.Msgs = append(p2.Msgs, m)
p2.Msgs = append(p2.Msgs, *m)
err = setJobPayloadJSONUnsafe(p.JobCallbackID64, p2)
logOnError(err, "jobShopsSlave : setJobPayloadJSONUnsafe")
muxObjJob.Unlock()
@ -2263,13 +2263,13 @@ func jobShopsSlave(j Job) {
b2 := getJobPayloadUnsafe(p.JobCallbackID64)
var p2 JobPayloadShops
err = json.Unmarshal(b2, &p2)
p2.Msgs = append(p2.Msgs, m)
p2.Msgs = append(p2.Msgs, *m)
err = setJobPayloadJSONUnsafe(p.JobCallbackID64, p2)
muxObjJob.Unlock()
for i, link := range p.Shops {
if cwm.Link == link {
p.Shops = append(p.Shops[:i], p.Shops[i+1:])
p.Shops = append(p.Shops[:i], p.Shops[i+1:]...)
break
}
}
@ -2299,7 +2299,7 @@ func jobShopsSlave(j Job) {
// if last job to finish then we wake up the master
if p2.Status == p.Slaves {
rescheduleJob(j.JobCallbackID64, 0, time.Now().UTC())
rescheduleJob(p.JobCallbackID64, 0, time.Now().UTC())
}
err = setJobDone(j.ID64)