Commit f01436fb authored by vicotor's avatar vicotor

update protocol

parent 5359ba67
......@@ -5,9 +5,7 @@ import (
"github.com/gogo/protobuf/proto"
odysseus "github.com/odysseus/odysseus-protocol/gen/proto/go/base/v1"
"github.com/odysseus/scheduler/config"
"github.com/odysseus/scheduler/utils"
log "github.com/sirupsen/logrus"
"strconv"
"strings"
"time"
)
......@@ -78,9 +76,10 @@ func produceTask() {
func makeTask() *odysseus.TaskContent {
task := &odysseus.TaskContent{
TaskId: strconv.FormatInt(utils.GetSnowflakeId(), 10),
TaskType: odysseus.TaskType_CustomTask,
TaskCmd: "echo \"hello world\"",
TaskUuid: "1111111",
TaskId: 1,
TaskType: odysseus.TaskType_ComputeTask,
TaskCmd: "",
TaskParam: []byte("give me five"),
TaskTimestamp: uint64(time.Now().Unix()),
TaskCallback: "http://localhost:8080/callback",
......
......@@ -90,7 +90,7 @@ func (n *Node) Loop(idx int) {
worker, err := PopWorker(n.rdb)
if err == ErrNoWorker {
result := &odysseus.TaskResponse{
TaskId: task.TaskId,
TaskUuid: task.TaskUuid,
TaskUid: task.TaskUid,
TaskFee: task.TaskFee,
TaskIsSucceed: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment