This commit is contained in:
shoopea 2020-06-29 10:38:37 +02:00
parent 3a8aaf51ff
commit 1d23d24621

12
job.go
View File

@ -2082,10 +2082,10 @@ func jobGetStash(j Job) {
if j.Trigger > 0 { if j.Trigger > 0 {
m, err := getObjMsg(j.Trigger) m, err := getObjMsg(j.Trigger)
logOnError(err, "jobAlchAll : getObjMsg("+strconv.FormatInt(j.Trigger, 10)+")") logOnError(err, "jobGetStash : getObjMsg("+strconv.FormatInt(j.Trigger, 10)+")")
if err == nil { if err == nil {
rule, err := getMsgParsingRule(m) rule, err := getMsgParsingRule(m)
logOnError(err, "jobAlchAll : getMsgParsingRule") logOnError(err, "jobGetStash : getMsgParsingRule")
if rule.MsgTypeID64 == cacheObjSubType[`msg_exchange_req`] { if rule.MsgTypeID64 == cacheObjSubType[`msg_exchange_req`] {
p.CleanupMsg = append(p.CleanupMsg, *m) p.CleanupMsg = append(p.CleanupMsg, *m)
setJobPayloadJSON(j.ID64, p) setJobPayloadJSON(j.ID64, p)
@ -2093,10 +2093,14 @@ func jobGetStash(j Job) {
return return
} else if rule.MsgTypeID64 == cacheObjSubType[`msg_exchange_ack`] { } else if rule.MsgTypeID64 == cacheObjSubType[`msg_exchange_ack`] {
p.CleanupMsg = append(p.CleanupMsg, *m) p.CleanupMsg = append(p.CleanupMsg, *m)
fmt.Printf("jobGetStash : finding client")
for k, v := range p.ClientID64 { for k, v := range p.ClientID64 {
fmt.Printf("jobGetStash : testing client [%d] : %d", k, v)
if v == j.UserID64 { if v == j.UserID64 {
p.ClientID64[len(p.ClientID64)-1], p.ClientID64[k] = p.ClientID64[k], p.ClientID64[len(p.ClientID64)-1] fmt.Printf("jobGetStash : deleting client")
p.ClientID64 = p.ClientID64[:len(p.ClientID64)-1] l := len(p.ClientID64)
p.ClientID64[l-1], p.ClientID64[k] = p.ClientID64[k], p.ClientID64[l-1]
p.ClientID64 = p.ClientID64[:l-1]
} }
} }
j.Trigger = 0 j.Trigger = 0