|
|
|
@ -374,7 +374,11 @@ func (d *Discovery) register(ctx context.Context, ins *naming.Instance) (err err |
|
|
|
|
params.Add("addrs", addr) |
|
|
|
|
} |
|
|
|
|
params.Set("version", ins.Version) |
|
|
|
|
params.Set("status", _statusUP) |
|
|
|
|
if ins.Status == 0 { |
|
|
|
|
params.Set("status", _statusUP) |
|
|
|
|
} else { |
|
|
|
|
params.Set("status", strconv.FormatInt(ins.Status, 10)) |
|
|
|
|
} |
|
|
|
|
params.Set("metadata", string(metadata)) |
|
|
|
|
if err = d.httpClient.Post(ctx, uri, "", params, &res); err != nil { |
|
|
|
|
d.switchNode() |
|
|
|
@ -471,7 +475,7 @@ func (d *Discovery) set(ctx context.Context, ins *naming.Instance) (err error) { |
|
|
|
|
params := d.newParams(conf) |
|
|
|
|
params.Set("appid", ins.AppID) |
|
|
|
|
params.Set("version", ins.Version) |
|
|
|
|
params.Set("status", _statusUP) |
|
|
|
|
params.Set("status", strconv.FormatInt(ins.Status, 10)) |
|
|
|
|
if ins.Metadata != nil { |
|
|
|
|
var metadata []byte |
|
|
|
|
if metadata, err = json.Marshal(ins.Metadata); err != nil { |
|
|
|
|