Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce logging #547

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion routes/admin_fees.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions routes/hot_feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) {
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions routes/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
Loading