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.
}
log.WithField("elem", elem).Debug("lPop worker")
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 {
log.WithError(err).Error("get worker status failed")
continue
......
......@@ -54,8 +54,8 @@ func workerResourceInfoKey(addr string) string {
return config.WORKER_RESOURCE_INFO_PREFIX + addr
}
func workerStatusKey(wid string) string {
return fmt.Sprintf("%s_%s", config.WORKER_STATUS_PREFIX, wid)
func workerStatusKey(addr string, nonce int64) string {
return fmt.Sprintf("%s_%s_%d", config.WORKER_STATUS_PREFIX, addr, nonce)
}
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