-
Notifications
You must be signed in to change notification settings - Fork 14
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
#3887 - Limit Parallel Processing #3933
#3887 - Limit Parallel Processing #3933
Conversation
progress?: (currentRecord: number) => Promise<void> | void; | ||
partialResults?: (results: P[]) => Promise<void> | void; |
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.
Amazing way to extend the the capability of the method. ❤️
progress?: (currentRecord: number) => Promise<void> | void; | ||
partialResults?: (results: P[]) => Promise<void> | void; |
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 about processPartialResults
?
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.
I like Dheepak's suggestion.
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.
For progress
it could be updateProgress
.
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.
processPartialResults
can indicate that a process will be executed with the records, which may be or may not be the case.
Yes, the current method consuming it is executing some processing, but the processInParallel
is just communicating that some partial results are done.
Between progress
and updateProgress
I would stick with progress
.
Please let me know if some of those are not suggestions.
{ | ||
progress: (currentBulk) => { | ||
this.logger.log( | ||
`Inserted record bulk ${currentBulk} of ${fedRestrictionsBulks.length}.`, |
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.
👍
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.
Great work refactoring the existing process and updating the process in parallel framework.
} | ||
} catch (error: unknown) { | ||
result.errorsSummary.push( | ||
"Error while generating notifications. See logs for details", |
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.
Period at the end of the phrase.
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.
Added the period.
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.
Looks good! Great job! Just minor comments.
Added period.
|
processInParallel
method.processInParallel
to keep the existing features from the methods refactored.currentRecord
allows progress report (added to satisfy SFAS integration and also used for Fed restrictions now).partialResults
allow access to lasted awaited promises batch (added to satisfy offering bulk upload).Federal Restriction Benchmark
The amount of parallel promises allowed was reduced from 4 to 2. Even though the bulk size of 750 was faster in local tests it was kept as 500 to avoid overloading the DB.
Bulk Offering Upload