diff --git a/internal/db/p2p_replicator.go b/internal/db/p2p_replicator.go index 88d440a761..9f2fd84215 100644 --- a/internal/db/p2p_replicator.go +++ b/internal/db/p2p_replicator.go @@ -131,7 +131,7 @@ func (db *db) SetReplicator(ctx context.Context, rep client.Replicator) error { db.events.Publish(event.NewMessage(event.ReplicatorName, event.Replicator{ Info: rep.Info, Schemas: storedSchemas, - Docs: db.getDocsHeads(ctx, addedCols), + Docs: db.getDocsHeads(context.Background(), addedCols), })) }) diff --git a/net/peer.go b/net/peer.go index bafd02fb92..00ea8653a0 100644 --- a/net/peer.go +++ b/net/peer.go @@ -219,8 +219,6 @@ func NewPeer( cancel: cancel, } - p.bus.Publish(event.NewMessage(event.PeerInfoName, event.PeerInfo{Info: p.PeerInfo()})) - p.server, err = newServer(p, options.GRPCDialOptions...) if err != nil { return nil, err @@ -282,6 +280,8 @@ func (p *Peer) Start() error { } }() + p.bus.Publish(event.NewMessage(event.PeerInfoName, event.PeerInfo{Info: p.PeerInfo()})) + return nil }