Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Veronika Solovei committed Jun 2, 2021
1 parent 0e87b44 commit 697a991
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions exchange/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ func (e *exchange) HoldAuction(ctx context.Context, r AuctionRequest, debugLog *
}

if debugLog == nil {
debugLog = &DebugLog{Enabled: false}
debugLog = &DebugLog{Enabled: false, DebugEnabledOrOverridden: false}
}

requestDebugInfo := getDebugInfo(r.BidRequest, requestExt)

debugInfo := debugLog.DebugOverride || (requestDebugInfo && r.Account.DebugAllow)
debugLog.Enabled = debugLog.DebugOverride || (debugLog.Enabled && r.Account.DebugAllow)
debugInfo := debugLog.DebugEnabledOrOverridden || (requestDebugInfo && r.Account.DebugAllow)
debugLog.Enabled = debugLog.DebugEnabledOrOverridden || r.Account.DebugAllow

if debugInfo {
ctx = e.makeDebugContext(ctx, debugInfo)
Expand Down
2 changes: 1 addition & 1 deletion exchange/exchange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func TestDebugBehaviour(t *testing.T) {
}
debugLog := &DebugLog{}
if test.debugData.headerOverrideDebugAllowed {
debugLog = &DebugLog{DebugOverride: true}
debugLog = &DebugLog{DebugOverride: true, DebugEnabledOrOverridden: true}
}
// Run test
outBidResponse, err := e.HoldAuction(ctx, auctionRequest, debugLog)
Expand Down

0 comments on commit 697a991

Please sign in to comment.