Node: Add logging around DB writes (#2820)
Change-Id: I1c0da08a39ee1ebbd4d62ccb74d550ec8fb06e0c
This commit is contained in:
parent
3eefb74bfb
commit
d2e5d04486
|
@ -277,11 +277,12 @@ func (acct *Accountant) publishTransferAlreadyLocked(pe *pendingEntry) {
|
|||
|
||||
// addPendingTransferAlreadyLocked adds a pending transfer to both the map and the database. It assumes the caller holds the lock.
|
||||
func (acct *Accountant) addPendingTransferAlreadyLocked(pe *pendingEntry) error {
|
||||
acct.logger.Debug("addPendingTransferAlreadyLocked", zap.String("msgId", pe.msgId))
|
||||
acct.logger.Info("writing transfer to database", zap.String("msgId", pe.msgId))
|
||||
pe.setUpdTime()
|
||||
if err := acct.db.AcctStorePendingTransfer(pe.msg); err != nil {
|
||||
return err
|
||||
}
|
||||
acct.logger.Info("wrote message to database", zap.String("msgId", pe.msgId))
|
||||
|
||||
acct.pendingTransfers[pe.msgId] = pe
|
||||
transfersOutstanding.Set(float64(len(acct.pendingTransfers)))
|
||||
|
|
|
@ -398,6 +398,7 @@ func (gov *ChainGovernor) ProcessMsgForTime(msg *common.MessagePublication, now
|
|||
|
||||
if enqueueIt {
|
||||
dbData := db.PendingTransfer{ReleaseTime: releaseTime, Msg: *msg}
|
||||
gov.logger.Info("writing pending transfer to database", zap.String("msgId", msg.MessageIDString()))
|
||||
err = gov.db.StorePendingMsg(&dbData)
|
||||
if err != nil {
|
||||
gov.logger.Error("failed to store pending vaa",
|
||||
|
@ -408,6 +409,7 @@ func (gov *ChainGovernor) ProcessMsgForTime(msg *common.MessagePublication, now
|
|||
)
|
||||
return false, err
|
||||
}
|
||||
gov.logger.Info("wrote pending transfer to database", zap.String("msgId", msg.MessageIDString()))
|
||||
|
||||
ce.pending = append(ce.pending, &pendingEntry{token: token, amount: payload.Amount, hash: hash, dbData: dbData})
|
||||
gov.msgsSeen[hash] = transferEnqueued
|
||||
|
|
Loading…
Reference in New Issue