rob05c commented on a change in pull request #3053: Traffic Monitor Disk Support
URL: https://github.com/apache/trafficcontrol/pull/3053#discussion_r240337540
##########
File path: traffic_monitor/towrap/towrap.go
##########
@@ -229,16 +244,36 @@ func (s *TrafficOpsSessionThreadsafe) CRConfigValid(crc
*tc.CRConfig, cdn string
// CRConfigRaw returns the CRConfig from the Traffic Ops. This is safe for
multiple goroutines.
func (s TrafficOpsSessionThreadsafe) CRConfigRaw(cdn string) ([]byte, error) {
+
ss := s.get()
+
+ var b []byte
+ var err error
+ var remoteAddr string
+ var reqInf client.ReqInf
+
if ss == nil {
return nil, ErrNilSession
+ } else {
+ b, reqInf, err = ss.GetCRConfig(cdn)
+ if err == nil {
+ remoteAddr = reqInf.RemoteAddr.String()
+ ioutil.WriteFile(s.CrConfigBackupFile, b, 0644)
+ } else {
+ if s.BackupFileExists() {
+ b, _ = ioutil.ReadFile(s.CrConfigBackupFile)
Review comment:
Need to check this error
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services