-
Notifications
You must be signed in to change notification settings - Fork 224
fix(analytics): guard long-running sandboxes and set proper report timeout #1686
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?
fix(analytics): guard long-running sandboxes and set proper report timeout #1686
Conversation
| if sandbox.StartTime.IsZero() { | ||
| continue | ||
| } | ||
| if now.Sub(sandbox.StartTime) > oldSandboxThreshold { |
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.
can we keep
time.Since(sandbox.StartTime) > oldSandboxThreshold
I think it's more readable and the improvement is negligible
| if sandbox.StartTime.IsZero() { | ||
| continue | ||
| } |
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.
this check isn't really needed
| instanceIds := make([]string, 0, len(instances)) | ||
| executionIds := make([]string, 0, len(instances)) |
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.
We know the length will be exactly instances, so it's seems to be safe to preallocate and do it as it is now. What was the reason behind this change?
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.
Well ok — given your current logic always appends exactly one entry per instance, this change doesn’t add much value. I will revert it to keep the code simpler.
nowtimestamp for consistent evaluation within each ticksyncAnalyticsTimewithreportTimeoutfor analytics request context