fix: optimize profile_by_app_group_name to query only active AppGroups#308
fix: optimize profile_by_app_group_name to query only active AppGroups#308ce314007 wants to merge 3 commits into
Conversation
| ) | ||
|
|
||
| if @app_group.blank? || !@app_group.ACTIVE? | ||
| if @app_group.blank? || @app_group.status != "ACTIVE" |
There was a problem hiding this comment.
we don't need the @app_group.status != "ACTIVE" since it already filter on find_by process.
| @helm_infrastructure = @app_group.helm_infrastructure_in_default_location | ||
| @helm_infrastructure = @app_group.helm_infrastructures.active.first unless @helm_infrastructure.present? | ||
|
|
||
| if @helm_infrastructure.blank? |
There was a problem hiding this comment.
do we need this check inside the present? since it will never be called.
| ) | ||
|
|
||
| if @app_group.blank? || !@app_group.ACTIVE? | ||
| if @app_group.blank? || @app_group.status != "ACTIVE" |
There was a problem hiding this comment.
similar from above related to status != "ACTIVE"
| }, status: :not_found) && return | ||
| end | ||
|
|
||
| if @helm_infrastructure.blank? |
There was a problem hiding this comment.
I don't think we need this right? where @helm_infrastructure defined?
There was a problem hiding this comment.
in my case when testing in local, its happen if there are appgroups that have provisioning status PENDING and status INACTIVE, . if i remove this, it will throw a random html response if i hit the appgroup that have condition like that.
There was a problem hiding this comment.
what's this random html? is it 404 or 500? if it is 404, I guess it is expected because it is still not active, wdyt @fadlinurhasan
There was a problem hiding this comment.
its 404, make sense, will update it
No description provided.