-
Notifications
You must be signed in to change notification settings - Fork 3
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: refactor getDestFromSrc #39
fix: refactor getDestFromSrc #39
Conversation
@@ -3,27 +3,27 @@ | |||
{ "name": "~pr" }, | |||
{ "name": "~commit" }, | |||
{ "name": "A" }, | |||
{ "name": "sd@777:external-level1" }, |
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.
The order seems to change a bit.
lib/getWorkflow.js
Outdated
* @param {Number} pipelineId Id of the current pipeline | ||
* @param {Object} jobs Hash of job configurations | ||
* @param {TriggerFactory} triggerFactory Trigger Factory to find external triggers | ||
* @param {Number} pipelineId Id of the current pipeline |
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.
[nits] pipelineId
was removed.
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 PR is included in version 3.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Context
triggerFactory.getDestFromSrc()
is called a number of times proportional to the number of jobs defined in the pipeline. (source-code)Since
getDestFromSrc()
executes heavy queries to the DB, the number of times it should be reduced as much as possible.It is called with the same argument in
calculateNodes()
andcalculateEdges()
, and the number of times it is called increases tremendously as the number of jobs increases.Objective
I refactored it to halve the number of calls in
calculateNodes()
andcalculateEdges()
.References
License
I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.