Commit 9cf348a5 authored by vicotor's avatar vicotor

fix bug

parent 318b3a38
...@@ -373,7 +373,7 @@ func (n *Node) PopWorker(ctx context.Context, rdb *redis.Client, task *odysseus. ...@@ -373,7 +373,7 @@ func (n *Node) PopWorker(ctx context.Context, rdb *redis.Client, task *odysseus.
} }
log.WithField("elem", elem).Debug("lPop worker") log.WithField("elem", elem).Debug("lPop worker")
addr, nonce := parseWorkerId(elem) addr, nonce := parseWorkerId(elem)
managerList, err := rdb.SMembers(context.Background(), workerStatusKey(elem)).Result() managerList, err := rdb.SMembers(context.Background(), workerStatusKey(addr, nonce)).Result()
if err != nil { if err != nil {
log.WithError(err).Error("get worker status failed") log.WithError(err).Error("get worker status failed")
continue continue
......
...@@ -54,8 +54,8 @@ func workerResourceInfoKey(addr string) string { ...@@ -54,8 +54,8 @@ func workerResourceInfoKey(addr string) string {
return config.WORKER_RESOURCE_INFO_PREFIX + addr return config.WORKER_RESOURCE_INFO_PREFIX + addr
} }
func workerStatusKey(wid string) string { func workerStatusKey(addr string, nonce int64) string {
return fmt.Sprintf("%s_%s", config.WORKER_STATUS_PREFIX, wid) return fmt.Sprintf("%s_%s_%d", config.WORKER_STATUS_PREFIX, addr, nonce)
} }
func newManagerClient(endpoint string) (omanager.NodeManagerServiceClient, error) { func newManagerClient(endpoint string) (omanager.NodeManagerServiceClient, error) {
......
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