This is an automated email from the ASF dual-hosted git repository.

journey pushed a commit to branch dev-1.3.0
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/dev-1.3.0 by this push:
     new 8cb4cd2  fix getWorkers bug on RunConfig (#2747)
8cb4cd2 is described below

commit 8cb4cd23ca386da7ca23fd58d4482db75198c253
Author: dailidong <[email protected]>
AuthorDate: Tue May 19 09:59:23 2020 +0800

    fix getWorkers bug on RunConfig (#2747)
    
    * fix worker group config no effect
    
    * remove codehaus janino jar
    the license about janino maybe not compatiable with Apache v2
    
    * Merge remote-tracking branch 'upstream/dev-1.3.0' into dev-1.3.0
    
    # Conflicts:
    #   dolphinscheduler-server/src/main/resources/config/install_config.conf
    
    * datasource config
    
    * Update datasource.properties
    
    * fix RunConfig bug
---
 .../apache/dolphinscheduler/server/monitor/RunConfig.java | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git 
a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/monitor/RunConfig.java
 
b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/monitor/RunConfig.java
index 4efe23e..484958e 100644
--- 
a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/monitor/RunConfig.java
+++ 
b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/monitor/RunConfig.java
@@ -16,6 +16,8 @@
  */
 package org.apache.dolphinscheduler.server.monitor;
 
+import org.apache.dolphinscheduler.common.Constants;
+import org.apache.dolphinscheduler.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.PropertySource;
 import org.springframework.stereotype.Component;
@@ -52,7 +54,18 @@ public class RunConfig {
     }
 
     public String getWorkers() {
-        return workers;
+        StringBuilder sb = new StringBuilder(50);
+        if(StringUtils.isNotBlank(workers)){
+            String[] workersArr = workers.trim().split(Constants.COMMA);
+            for (String workerGroup : workersArr) {
+                
sb.append(workerGroup.split(Constants.COLON)[0]).append(Constants.COMMA);
+            }
+        }
+        if( sb.length() > 0) {
+            sb.deleteCharAt(sb.length() - 1);
+        }
+
+        return sb.toString();
     }
 
     public void setWorkers(String workers) {

Reply via email to