Commit d00123cd authored by vicotor's avatar vicotor

fix bug

parent 03496321
......@@ -3,6 +3,7 @@ package server
import (
"context"
"errors"
"fmt"
odysseus "github.com/odysseus/odysseus-protocol/gen/proto/go/base/v1"
omanager "github.com/odysseus/odysseus-protocol/gen/proto/go/nodemanager/v1"
"github.com/odysseus/scheduler/config"
......@@ -37,7 +38,7 @@ func PopWorker(rdb *redis.Client) (Worker, error) {
break
}
log.WithField("elem", elem).Debug("lPop worker")
managerList, err := rdb.SMembers(context.Background(), config.WORKER_STATUS_PREFIX+elem).Result()
managerList, err := rdb.SMembers(context.Background(), workerStatusKey(elem)).Result()
if err != nil {
log.WithError(err).Error("get worker status failed")
continue
......@@ -56,6 +57,9 @@ func PopWorker(rdb *redis.Client) (Worker, error) {
}
return Worker{}, ErrNoWorker
}
func workerStatusKey(wid string) string {
return fmt.Sprintf("%s_%s", config.WORKER_STATUS_PREFIX, wid)
}
func newManagerClient(endpoint string) (omanager.NodeManagerServiceClient, error) {
client, err := grpc.Dial(endpoint,
......
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