-
Notifications
You must be signed in to change notification settings - Fork 432
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
fix(sdk): sample record validation errors #2794
Conversation
metrics.increment(metrics.Types.RUNNER_INVALID_SYNCS_RECORDS); | ||
|
||
if (this.runnerFlags?.validateSyncRecords) { | ||
break; | ||
} |
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.
what is this if
for?
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.
early break if enabled
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.
otherwise it just logs everything*
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.
hasErrors is never gonna have more than 1 element then if we always early break
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.
yes sorry it's maybe not clear, this flag is only set to true in CLI
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.
ah ok. so in CLI it breaks out after the first validation error
Describe your changes
Fixes https://linear.app/nango/issue/NAN-1833/reduce-validation-logs-andor-process-in-parallel
Sample record validation errors
It's spamming the infra, making syncs slower than they should be.
Send the sample in parallel
Don't remember why I didn't do it like this. It complexifies the code a bit but faster; since we sample it's no longer a big problem but can be useful if we increase the sampling or remove it.