[#488] cmd/reputation: Add DaughterStorage

Add `DaughterStorage` init in main pkg
and start write all received daughters'
trusts to it.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-04-21 07:56:38 +03:00 committed by Alex Vanin
parent 56b3e35779
commit f6783f4f81
8 changed files with 53 additions and 37 deletions

View file

@ -65,7 +65,7 @@ func (r *Router) InitWriter(ctx common.Context) (common.Writer, error) {
}, nil
}
func (w *trustWriter) Write(t reputation.Trust) error {
func (w *trustWriter) Write(ctx common.Context, t reputation.Trust) error {
w.routeMtx.Lock()
defer w.routeMtx.Unlock()
@ -106,7 +106,7 @@ func (w *trustWriter) Write(t reputation.Trust) error {
w.mServers[endpoint] = remoteWriter
}
err := remoteWriter.Write(t)
err := remoteWriter.Write(ctx, t)
if err != nil {
w.router.log.Debug("could not write the value",
zap.String("error", err.Error()),