Skip to content

Commit

Permalink
Publish legs updates to pando topic
Browse files Browse the repository at this point in the history
Change the legs topic name to use pando and log any errors when legs
fails to announce update.
  • Loading branch information
masih committed Feb 15, 2022
1 parent ded398a commit f7ffb10
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions controller/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func newStateDBWithNotify(ctx context.Context, dbConn DBConnector, migrator Migr
}

b := dbDS("legs_data", st.db())
pub, err := dtsync.NewPublisher(host, b, storeLS, "/dealbot/v1.0.0")
pub, err := dtsync.NewPublisher(host, b, storeLS, "/pando/v0.0.1")
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -1011,7 +1011,10 @@ func (s *stateDB) PublishRecordsFrom(ctx context.Context, worker string) error {
return err
}
if s.legs != nil {
s.legs.UpdateRoot(ctx, updateCid.(cidlink.Link).Cid)
err := s.legs.UpdateRoot(ctx, updateCid.(cidlink.Link).Cid)
if err != nil {
log.Errorw("failed to update legs root", "err", err)
}
}

if _, err = tx.ExecContext(ctx, addHeadSQL, updateCid.(cidlink.Link).Cid.String(), time.Now(), "", LATEST_UPDATE); err != nil {
Expand Down

0 comments on commit f7ffb10

Please sign in to comment.