Skip to content

Commit

Permalink
fix: no logging tx hash when consuming failure
Browse files Browse the repository at this point in the history
  • Loading branch information
iczc committed Aug 4, 2021
1 parent 2305099 commit e823d6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 1 addition & 3 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ func init() {

func initConfig() *viper.Viper {
v := viper.New()
v.SetConfigName("config")
v.SetConfigType("yml")
v.AddConfigPath(".")
v.SetConfigFile("./config.yml")
if err := v.ReadInConfig(); err != nil {
panic(err)
}
Expand Down
11 changes: 6 additions & 5 deletions internal/faucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ func (f *faucet) SetPayoutEther(amount int64) {

func (f *faucet) Run() {
for address := range f.queue {
txHash, err := f.Transfer(context.Background(), address, f.payout)
txHash, err := f.Transfer(context.Background(), address, f.GetPayoutWei())
if err != nil {
log.WithError(err).Error("Failed to handle transaction in the queue")
} else {
log.WithFields(log.Fields{
"txHash": txHash,
"address": address,
}).Info("Consume from queue successfully")
}
log.WithFields(log.Fields{
"txHash": txHash,
"address": address,
}).Info("Consume from queue successfully")
}
}

Expand Down

0 comments on commit e823d6a

Please sign in to comment.