ustcweizhou commented on a change in pull request #3331: api/server: Add option 
'details' to listProjects and listAccounts
URL: https://github.com/apache/cloudstack/pull/3331#discussion_r284835590
 
 

 ##########
 File path: server/src/main/java/com/cloud/api/query/dao/ProjectJoinDaoImpl.java
 ##########
 @@ -91,9 +94,11 @@ public ProjectResponse newProjectResponse(ProjectJoinVO 
proj) {
 
         //set resource limit/count information for the project (by getting the 
info of the project's account)
         Account account = 
_accountDao.findByIdIncludingRemoved(proj.getProjectAccountId());
-        AccountJoinVO accountJn = ApiDBUtils.newAccountView(account);
-        _accountJoinDao.setResourceLimits(accountJn, false, response);
-        response.setProjectAccountName(accountJn.getAccountName());
+        if (details.contains(DomainDetails.all) || 
details.contains(DomainDetails.resource)) {
+            AccountJoinVO accountJn = ApiDBUtils.newAccountView(account);
 
 Review comment:
   line 98 takes around 0.2 seconds for each project in my testing environment.
   The actual time depends on how many accounts in your system.
   ```
   AccountJoinVO accountJn = ApiDBUtils.newAccountView(account);
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to