Commit 4c40ad4e authored by vicotor's avatar vicotor

update worker registry

parent b6f1a32a
......@@ -605,14 +605,16 @@ func (wm *WorkerManager) handleWorkerMsg(worker *Worker) {
worker.workerAddr = utils.PubkeyToAddress(pubkey)
}
wreg := workerRegistry{
worker: worker,
wm: wm,
}
reg := registry.NewRegistry(registry.RedisConnParam{
Addr: config.GetConfig().Redis.Addr,
Password: config.GetConfig().Redis.Password,
DbIndex: config.GetConfig().Redis.DbIndex,
}, workerRegistry{
worker: worker,
wm: wm,
})
}, wreg, wreg.Instance)
go reg.Start()
wm.SetWorkerRegistry(worker.uuid, reg)
......
......@@ -46,5 +46,6 @@ func (w workerRegistry) DetailInfo() (json.RawMessage, error) {
info.ActiveNM, _ = w.wm.WorkerNmList(w.worker)
info.HearBeat = w.wm.GetHeartBeat(w.worker.uuid)
info.MinerAddress = w.worker.workerAddr
info.Nonce = int64(w.worker.nonce)
return json.Marshal(info)
}
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