Commit f01436fb authored by vicotor's avatar vicotor

update protocol

parent 5359ba67
...@@ -5,9 +5,7 @@ import ( ...@@ -5,9 +5,7 @@ import (
"github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/proto"
odysseus "github.com/odysseus/odysseus-protocol/gen/proto/go/base/v1" odysseus "github.com/odysseus/odysseus-protocol/gen/proto/go/base/v1"
"github.com/odysseus/scheduler/config" "github.com/odysseus/scheduler/config"
"github.com/odysseus/scheduler/utils"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"strconv"
"strings" "strings"
"time" "time"
) )
...@@ -78,9 +76,10 @@ func produceTask() { ...@@ -78,9 +76,10 @@ func produceTask() {
func makeTask() *odysseus.TaskContent { func makeTask() *odysseus.TaskContent {
task := &odysseus.TaskContent{ task := &odysseus.TaskContent{
TaskId: strconv.FormatInt(utils.GetSnowflakeId(), 10), TaskUuid: "1111111",
TaskType: odysseus.TaskType_CustomTask, TaskId: 1,
TaskCmd: "echo \"hello world\"", TaskType: odysseus.TaskType_ComputeTask,
TaskCmd: "",
TaskParam: []byte("give me five"), TaskParam: []byte("give me five"),
TaskTimestamp: uint64(time.Now().Unix()), TaskTimestamp: uint64(time.Now().Unix()),
TaskCallback: "http://localhost:8080/callback", TaskCallback: "http://localhost:8080/callback",
......
...@@ -90,7 +90,7 @@ func (n *Node) Loop(idx int) { ...@@ -90,7 +90,7 @@ func (n *Node) Loop(idx int) {
worker, err := PopWorker(n.rdb) worker, err := PopWorker(n.rdb)
if err == ErrNoWorker { if err == ErrNoWorker {
result := &odysseus.TaskResponse{ result := &odysseus.TaskResponse{
TaskId: task.TaskId, TaskUuid: task.TaskUuid,
TaskUid: task.TaskUid, TaskUid: task.TaskUid,
TaskFee: task.TaskFee, TaskFee: task.TaskFee,
TaskIsSucceed: false, 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