This commit is contained in:
barnett 2018-12-02 21:34:53 +08:00
commit fd1d4a96d0
2 changed files with 9 additions and 1 deletions

View File

@ -23,6 +23,7 @@ import (
"github.com/Sirupsen/logrus"
api_db "github.com/goodrain/rainbond/api/db"
"github.com/goodrain/rainbond/mq/api/grpc/client"
"github.com/goodrain/rainbond/worker/discover"
"github.com/pquerna/ffjson/ffjson"
)
@ -36,7 +37,7 @@ func sendTask(body map[string]interface{}, taskType string, mqClient *client.MQC
TaskBody: bodyJ,
User: "define",
}
eq, errEq := api_db.BuildTaskBuild(bs)
eq, errEq := api_db.BuildTaskBuildWithTopic(bs, discover.WTOPIC)
if errEq != nil {
logrus.Errorf("build equeue stop request error, %v", errEq)
return errEq

View File

@ -127,6 +127,13 @@ func NewTaskBody(taskType string, body []byte) TaskBody {
return nil
}
return b
case "apply_rule":
b := ApplyRuleTaskBody{}
err := ffjson.Unmarshal(body, &b)
if err != nil {
return nil
}
return b
default:
return DefaultTaskBody{}
}