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