You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/01/31 17:08:05 UTC

[GitHub] [incubator-superset] etr2460 commented on a change in pull request #9060: [domain sharding] Freeup main domain when domain sharding is enabled

etr2460 commented on a change in pull request #9060: [domain sharding] Freeup main domain when domain sharding is enabled
URL: https://github.com/apache/incubator-superset/pull/9060#discussion_r373586638
 
 

 ##########
 File path: superset/assets/src/explore/exploreUtils.js
 ##########
 @@ -32,6 +32,12 @@ let requestCounter = 0;
 function getHostName(allowDomainSharding = false) {
   let currentIndex = 0;
   if (allowDomainSharding) {
+    // if domain sharding is enabled, skip main domain for fetching chart API
+    // leave main domain free for other calls like fav star, save change, etc.
+    // to make dashboard be responsive when it's loading large number of charts
+    if (requestCounter % availableDomains.length === 0) {
+      requestCounter += 1;
+    }
 
 Review comment:
   minor nit: since you're duplicating the `requestCounter % availableDomains.length` logic from below, might it be simpler to do:
   
   ```js
   if (allowDomainSharding) {
     currentIndex = requestCounter % availableDomains.length;
     requestCounter += 1;
   
     // if domain sharding is enabled, skip main domain for fetching chart API
     // leave main domain free for other calls like fav star, save change, etc.
     // to make dashboard be responsive when it's loading large number of charts
     if (currentIndex === 0) {
       currentIndex += 1;
       requestCounter += 1;
     }
   }
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org