rawlinp commented on a change in pull request #6527:
URL: https://github.com/apache/trafficcontrol/pull/6527#discussion_r804119961



##########
File path: traffic_monitor/datareq/crstate.go
##########
@@ -51,15 +58,36 @@ func srvTRState(params url.Values, localStates 
peer.CRStatesThreadsafe, combined
                }
        }
 
-       data, err := srvTRStateDerived(combinedStates, peerStates)
+       data, err := srvTRStateDerived(combinedStates, local && 
distributedPollingEnabled)
 
        return data, http.StatusOK, err
 }
 
-func srvTRStateDerived(combinedStates peer.CRStatesThreadsafe, peerStates 
peer.CRStatesPeersThreadsafe) ([]byte, error) {
-       return tc.CRStatesMarshall(combinedStates.Get())
+func srvTRStateDerived(combinedStates peer.CRStatesThreadsafe, 
directlyPolledOnly bool) ([]byte, error) {
+       if !directlyPolledOnly {

Review comment:
       On 2nd thought, `combinedStates` definitely contains all the caches, not 
just the directly-polled. So we do need the filtering.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to