Skip to content

Commit

Permalink
Merge pull request #156 from ipfs-force-community/chore/detail-log
Browse files Browse the repository at this point in the history
chore: add more connection log
  • Loading branch information
LinZexiao authored Oct 30, 2023
2 parents 04cce53 + 74d3916 commit d30bafb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions marketevent/market_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (m *MarketEventStream) ListenMarketEvent(ctx context.Context, policy *gtype

m.connLk.Unlock()
_ = channelStore.addChanel(channel)
log.Infof("add new connections %s for miner %s", channel.ChannelId, mAddr)
log.Infof("add new connections %s for miner(market) %s", channel.ChannelId, mAddr)
go func() {
connectBytes, err := json.Marshal(gtypes.ConnectedCompleted{
ChannelId: channel.ChannelId,
Expand Down Expand Up @@ -105,7 +105,7 @@ func (m *MarketEventStream) ListenMarketEvent(ctx context.Context, policy *gtype
if channelStore.empty() {
delete(m.minerConnections, mAddr)
}
log.Infof("remove connections %s of miner %s", channel.ChannelId, mAddr)
log.Infof("remove connections %s of miner(market) %s", channel.ChannelId, mAddr)
}()
return out, nil
}
Expand Down
4 changes: 2 additions & 2 deletions proofevent/proof_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ func (e *ProofEventStream) ListenProofEvent(ctx context.Context, policy *sharedG
e.connLk.Unlock()
}

log.Infof("remove connections %s of miner %s", channel.ChannelId, mAddr)
log.Infof("remove connections %s of miner(proof) %s", channel.ChannelId, mAddr)
}

e.connLk.Unlock()
_ = channelStore.addChanel(channel)
log.Infof("add new connections %s for miner %s", channel.ChannelId, mAddr)
log.Infof("add new connections %s for miner(proof) %s", channel.ChannelId, mAddr)
go func() {
connectBytes, err := json.Marshal(sharedGatewayTypes.ConnectedCompleted{
ChannelId: channel.ChannelId,
Expand Down
5 changes: 3 additions & 2 deletions walletevent/wallet_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (w *WalletEventStream) ListenWalletEvent(ctx context.Context, policy *share
walletLog.Errorf("validate address error %v", err)
return
}
walletLog.Infof("add new connections %s", walletChannelInfo.ChannelId)
walletLog.Infof("add new connections %s for wallet", walletChannelInfo.ChannelId)

// register signer address to venus-auth
for _, account := range accounts {
Expand Down Expand Up @@ -128,7 +128,7 @@ func (w *WalletEventStream) ListenWalletEvent(ctx context.Context, policy *share
<-ctx.Done()
stats.Record(ctx, metrics.WalletUnregister.M(1))
if err = w.walletConnMgr.removeConn(walletAccount, walletChannelInfo); err != nil {
walletLog.Errorf("remove connect error %v", err)
walletLog.Errorf("remove connection %s failed: %v", walletChannelInfo.ChannelId, err)
} else { // nolint
// The records bound to the system will not have a lot of records, and there will be no additional effects.
// There are expenses and other potential risks for each disconnection of betting sales.
Expand All @@ -147,6 +147,7 @@ func (w *WalletEventStream) ListenWalletEvent(ctx context.Context, policy *share
// log.Infof("unregister %v for %s success", signers, walletAccount)
//}
}
walletLog.Infof("remove connection %s of wallet", walletChannelInfo.ChannelId)
}()
return out, nil
}
Expand Down

0 comments on commit d30bafb

Please sign in to comment.