From 1e914067b8a86636a99602fdad0de3d08f5d50f3 Mon Sep 17 00:00:00 2001 From: Lazy Nina Date: Wed, 28 Feb 2024 17:03:34 -0500 Subject: [PATCH] Reduce logging --- routes/admin_fees.go | 2 +- routes/hot_feed.go | 8 ++++---- routes/verify.go | 6 ++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/routes/admin_fees.go b/routes/admin_fees.go index 52eebe7f..d8c64829 100644 --- a/routes/admin_fees.go +++ b/routes/admin_fees.go @@ -255,7 +255,7 @@ func (fes *APIServer) GetTransactionFeeMapFromGlobalState() map[lib.TxnType][]*l var feeOutputs []*lib.DeSoOutput // Decode the bytes into the slice of DeSoOutputs if err = gob.NewDecoder(bytes.NewReader(desoOutputBytes)).Decode(&feeOutputs); err != nil { - glog.Infof("Error decoding desoOutputBytes to slice of DeSoOutputs: %v - default to no additional fees", err) + glog.V(2).Infof("Error decoding desoOutputBytes to slice of DeSoOutputs: %v - default to no additional fees", err) // Default to an empty slice. transactionFeeMap[txnType] = []*lib.DeSoOutput{} } else { diff --git a/routes/hot_feed.go b/routes/hot_feed.go index 9a884efa..9c1b127a 100644 --- a/routes/hot_feed.go +++ b/routes/hot_feed.go @@ -109,9 +109,9 @@ func (fes *APIServer) StartHotFeedRoutine() { // The business. func (fes *APIServer) UpdateHotFeed(resetCache bool) { - glog.Info("Refreshing hot feed...") + glog.V(2).Info("Refreshing hot feed...") if resetCache { - glog.Info("Resetting hot feed cache.") + glog.V(2).Info("Resetting hot feed cache.") fes.PostTagToPostHashesMap = make(map[string]map[lib.BlockHash]bool) fes.PostHashToPostTagsMap = make(map[lib.BlockHash][]string) fes.HotFeedBlockCache = make(map[lib.BlockHash]*lib.MsgDeSoBlock) @@ -137,7 +137,7 @@ func (fes *APIServer) UpdateHotFeed(resetCache bool) { // Replace the HotFeedApprovedPostsMap and HotFeedPKIDMultiplier map with the fresh ones. fes.HotFeedApprovedPostsToMultipliers = hotFeedApprovedPosts fes.HotFeedPKIDMultipliers = hotFeedPKIDMultipliers - glog.Infof("Updated hot feed maps") + glog.V(2).Infof("Updated hot feed maps") } func (fes *APIServer) UpdateHotFeedApprovedPostsMap(hotFeedApprovedPosts map[lib.BlockHash]float64) { @@ -412,7 +412,7 @@ func (fes *APIServer) UpdateHotFeedOrderedList( } // Log how long this routine takes, since it could be heavy. - glog.Info("UpdateHotFeedOrderedList: Starting new update cycle.") + glog.V(2).Info("UpdateHotFeedOrderedList: Starting new update cycle.") start := time.Now() // Get a utxoView for lookups. diff --git a/routes/verify.go b/routes/verify.go index e668b593..9c9910eb 100644 --- a/routes/verify.go +++ b/routes/verify.go @@ -1469,6 +1469,9 @@ func (fes *APIServer) SetJumioUSDCents() { glog.Errorf("SetJumioUSDCents: Error getting Jumio USD Cents from global state: %v", err) return } + if len(val) == 0 { + return + } jumioUSDCents, bytesRead := lib.Uvarint(val) if bytesRead <= 0 { glog.Errorf("SetJumioUSDCents: invalid bytes read: %v", bytesRead) @@ -1487,6 +1490,9 @@ func (fes *APIServer) SetJumioKickbackUSDCents() { glog.Errorf("SetJumioKickbackUSDCents: Error getting Jumio Kickback USD Cents from global state: %v", err) return } + if len(val) == 0 { + return + } jumioKickbackUSDCents, bytesRead := lib.Uvarint(val) if bytesRead <= 0 { glog.Errorf("SetJumioKickbackUSDCents: invalid bytes read: %v", bytesRead)