You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/07/29 21:51:36 UTC

[GitHub] [trafficcontrol] rob05c commented on a diff in pull request #6991: t3c log run mode and log update flag changes

rob05c commented on code in PR #6991:
URL: https://github.com/apache/trafficcontrol/pull/6991#discussion_r933637325


##########
cache-config/t3c-apply/torequest/torequest.go:
##########
@@ -1169,17 +1175,25 @@ func (r *TrafficOpsReq) UpdateTrafficOps(syncdsUpdate *UpdateStatus) error {
 
 	// TODO: The boolean flags/representation can be removed after ATC (v7.0+)
 	if !r.Cfg.ReportOnly && !r.Cfg.NoUnsetUpdateFlag {
+		start := time.Now()
+		apply := []string{}
+		var b bool
 		if r.Cfg.Files == t3cutil.ApplyFilesFlagAll {
-			b := false
+			b = false
+			apply = append(apply, "update")
+			log.Infof("Update flag currently set to %v, setting to %v", serverStatus.UpdatePending, b)
 			err = sendUpdate(r.Cfg, serverStatus.ConfigUpdateTime, nil, &b, nil)
 		} else if r.Cfg.Files == t3cutil.ApplyFilesFlagReval {
-			b := false
+			b = false
+			apply = append(apply, t3cutil.ApplyFilesFlagReval.String())

Review Comment:
   This has the text value you want, but this enum is semantically something completely different.
   The enum `ApplyFilesFlag` is the CLI flag for whether to apply all config files, or just the regex_revalidate.config file.
   Whereas here, the word "reval" is being used to indicate revalidate pending flag in Traffic Ops.
   
   That might confuse someone trying to understand the code in the future. Would you object to changing this to either a literal like update above, `"reval"`, or putting both in their own enum like `const TrafficOpsPendingFlag    TrafficOpsPendingFlagReval = "reval"`?



-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org