-
Notifications
You must be signed in to change notification settings - Fork 2
delay doneAt as needed #223
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
base: main
Are you sure you want to change the base?
Conversation
in terminal logs and directory output meta.jsons, this will output a json ``` {"middlewareRequestID":"c3e36c64","doneAt":"2025-10-13T17:06:32.026094+02:00"} {"middlewareRequestID":"777bfc30","doneAt":"2025-10-13T17:06:38.413933+02:00"} {"middlewareRequestID":"777bfc30","watchOptions":"-trunc(0)/-trunc(0)","when":"2025-10-13T15:06:38.385144025Z","normHost":"location.hotrod-devmesh.svc.cluster.local:8081","routingKey":"g9wqf90gqw9mj","destWorkload":"Deployment/hotrod-devmesh/location","requestURI":"http://sbr-dep-location-2c37fc13.hotrod-devmesh.svc:8081/locations","method":"GET","proto":"HTTP/1.1","userAgent":"curl/8.7.1"} ``` Note the order between doneAt and the initial request is not guaranteed (I think it would be hard and likely buggy to do so...) In request directories, the meta.jsons gets updated to include "doneAt":
- overwrite on first apply - fix retErrs overwrites - fix a couple of logic issues
* adds doneAt reporting in terminal logs and directory output meta.jsons, this will output a json ``` {"middlewareRequestID":"c3e36c64","doneAt":"2025-10-13T17:06:32.026094+02:00"} {"middlewareRequestID":"777bfc30","doneAt":"2025-10-13T17:06:38.413933+02:00"} {"middlewareRequestID":"777bfc30","watchOptions":"-trunc(0)/-trunc(0)","when":"2025-10-13T15:06:38.385144025Z","normHost":"location.hotrod-devmesh.svc.cluster.local:8081","routingKey":"g9wqf90gqw9mj","destWorkload":"Deployment/hotrod-devmesh/location","requestURI":"http://sbr-dep-location-2c37fc13.hotrod-devmesh.svc:8081/locations","method":"GET","proto":"HTTP/1.1","userAgent":"curl/8.7.1"} ``` Note the order between doneAt and the initial request is not guaranteed (I think it would be hard and likely buggy to do so...) In request directories, the meta.jsons gets updated to include "doneAt": * fixes to continuous readiness checking - overwrite on first apply - fix retErrs overwrites - fix a couple of logic issues
…ot/cli into tw-continuous-ready-match
* implementation of tw directory default also, - improve help - improve signal handling * add --clean flag * fix sentence in help * use -{json,yaml} for directory * update flags after discussion - no-instrument is hidden - --to has become --output-dir, which only applies when !short - --output-file may be provided with --short * check match consistency as well. * rename watch command to record * add 'r' alias for record * rename files to reflect 'record' command name * use trafficwatch.MiddlewareName everywhere * rename cli mw to trafficwatch from trafficwatch-client (depends on PR in signadot repo)
Gitar automatically fixes CI failures and addresses comments starting with ⚙️ Options:
🔄 To revert changes, post a comment:
* Gitar never force pushes to your branch |
func waitLogged(logged, done <-chan string) chan string { | ||
res := make(chan string) | ||
go func() { | ||
d := map[string]bool{} | ||
for { | ||
select { | ||
case id, ok := <-logged: | ||
if !ok { | ||
if done == nil { | ||
return | ||
} | ||
logged = nil | ||
} else { | ||
d[id] = true | ||
} | ||
case id, ok := <-done: | ||
if !ok { | ||
if logged == nil { | ||
return | ||
} | ||
done = nil | ||
} else { | ||
res <- id | ||
delete(d, id) | ||
} | ||
} | ||
} | ||
}() | ||
return res | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we supposed to use d
within this code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed but in a merge commit due to merge conflicts
6fd0371
This adds a filter to doneAt that delays it until after the initial received meta has been logged