@@ -116,10 +116,10 @@ func (impl AppListingRepositoryImpl) FetchJobs(appIds []int, statuses []string,
116
116
if len (appIds ) == 0 {
117
117
return jobContainers , nil
118
118
}
119
- jobsQuery := impl .appListingRepositoryQueryBuilder .BuildJobListingQuery (appIds , statuses , environmentIds , sortOrder )
119
+ jobsQuery , jobsQueryParams := impl .appListingRepositoryQueryBuilder .BuildJobListingQuery (appIds , statuses , environmentIds , sortOrder )
120
120
121
121
impl .Logger .Debugw ("basic app detail query: " , jobsQuery )
122
- _ , appsErr := impl .dbConnection .Query (& jobContainers , jobsQuery )
122
+ _ , appsErr := impl .dbConnection .Query (& jobContainers , jobsQuery , jobsQueryParams ... )
123
123
if appsErr != nil {
124
124
impl .Logger .Error (appsErr )
125
125
return jobContainers , appsErr
@@ -220,10 +220,10 @@ func (impl AppListingRepositoryImpl) FetchAppsByEnvironmentV2(appListingFilter h
220
220
221
221
if string (appListingFilter .SortBy ) == helper .LastDeployedSortBy {
222
222
223
- query := impl .appListingRepositoryQueryBuilder .GetAppIdsQueryWithPaginationForLastDeployedSearch (appListingFilter )
223
+ query , queryParams := impl .appListingRepositoryQueryBuilder .GetAppIdsQueryWithPaginationForLastDeployedSearch (appListingFilter )
224
224
impl .Logger .Debug ("GetAppIdsQueryWithPaginationForLastDeployedSearch query " , query )
225
225
start := time .Now ()
226
- _ , err := impl .dbConnection .Query (& lastDeployedTimeDTO , query )
226
+ _ , err := impl .dbConnection .Query (& lastDeployedTimeDTO , query , queryParams ... )
227
227
middleware .AppListingDuration .WithLabelValues ("getAppIdsQueryWithPaginationForLastDeployedSearch" , "devtron" ).Observe (time .Since (start ).Seconds ())
228
228
if err != nil || len (lastDeployedTimeDTO ) == 0 {
229
229
if err != nil {
@@ -238,9 +238,9 @@ func (impl AppListingRepositoryImpl) FetchAppsByEnvironmentV2(appListingFilter h
238
238
appIdsFound [i ] = obj .AppId
239
239
}
240
240
appListingFilter .AppIds = appIdsFound
241
- appContainerQuery := impl .appListingRepositoryQueryBuilder .GetQueryForAppEnvContainerss (appListingFilter )
242
- impl .Logger .Debug ("GetQueryForAppEnvContainerss query " , query )
243
- _ , err = impl .dbConnection .Query (& appEnvContainer , appContainerQuery )
241
+ appContainerQuery , appContainerQueryParams := impl .appListingRepositoryQueryBuilder .GetQueryForAppEnvContainers (appListingFilter )
242
+ impl .Logger .Debug ("GetQueryForAppEnvContainers query " , query )
243
+ _ , err = impl .dbConnection .Query (& appEnvContainer , appContainerQuery , appContainerQueryParams ... )
244
244
if err != nil {
245
245
impl .Logger .Errorw ("error in getting appEnvContainers with appList filter from db" , "err" , err , "filter" , appListingFilter , "query" , appContainerQuery )
246
246
return appEnvArr , appsSize , err
@@ -250,10 +250,10 @@ func (impl AppListingRepositoryImpl) FetchAppsByEnvironmentV2(appListingFilter h
250
250
251
251
// to get all the appIds in appEnvs allowed for user and filtered by the appListing filter and sorted by name
252
252
appIdCountDtos := make ([]* bean.AppEnvironmentContainer , 0 )
253
- appIdCountQuery := impl .appListingRepositoryQueryBuilder .GetAppIdsQueryWithPaginationForAppNameSearch (appListingFilter )
253
+ appIdCountQuery , appIdCountQueryParams := impl .appListingRepositoryQueryBuilder .GetAppIdsQueryWithPaginationForAppNameSearch (appListingFilter )
254
254
impl .Logger .Debug ("GetAppIdsQueryWithPaginationForAppNameSearch query " , appIdCountQuery )
255
255
start := time .Now ()
256
- _ , appsErr := impl .dbConnection .Query (& appIdCountDtos , appIdCountQuery )
256
+ _ , appsErr := impl .dbConnection .Query (& appIdCountDtos , appIdCountQuery , appIdCountQueryParams ... )
257
257
middleware .AppListingDuration .WithLabelValues ("getAppIdsQueryWithPaginationForAppNameSearch" , "devtron" ).Observe (time .Since (start ).Seconds ())
258
258
if appsErr != nil || len (appIdCountDtos ) == 0 {
259
259
if appsErr != nil {
@@ -271,10 +271,10 @@ func (impl AppListingRepositoryImpl) FetchAppsByEnvironmentV2(appListingFilter h
271
271
appListingFilter .AppIds = uniqueAppIds
272
272
// set appids required for this page in the filter and get the appEnv containers of these apps
273
273
appListingFilter .AppIds = uniqueAppIds
274
- appsEnvquery := impl .appListingRepositoryQueryBuilder .GetQueryForAppEnvContainerss (appListingFilter )
275
- impl .Logger .Debug ("GetQueryForAppEnvContainerss query: " , appsEnvquery )
274
+ appsEnvquery , appsEnvQueryParams := impl .appListingRepositoryQueryBuilder .GetQueryForAppEnvContainers (appListingFilter )
275
+ impl .Logger .Debug ("GetQueryForAppEnvContainers query: " , appsEnvquery )
276
276
start = time .Now ()
277
- _ , appsErr = impl .dbConnection .Query (& appEnvContainer , appsEnvquery )
277
+ _ , appsErr = impl .dbConnection .Query (& appEnvContainer , appsEnvquery , appsEnvQueryParams ... )
278
278
middleware .AppListingDuration .WithLabelValues ("buildAppListingQuery" , "devtron" ).Observe (time .Since (start ).Seconds ())
279
279
if appsErr != nil {
280
280
impl .Logger .Errorw ("error in getting appEnvContainers with appList filter from db" , "err" , appsErr , "filter" , appListingFilter , "query" , appsEnvquery )
0 commit comments