Unverified Commit 257a3ee3 authored by samz406's avatar samz406 Committed by GitHub
Browse files

Merge pull request #18 from apache/dev

update
parents 96d49a09 4032c4e6
Loading
Loading
Loading
Loading
+51 −0
Original line number Diff line number Diff line
@@ -15,26 +15,37 @@
# limitations under the License.
#

logging.config=classpath:combined_logback.xml

# server port
server.port=12345

# session config
server.servlet.session.timeout=7200

server.servlet.context-path=/dolphinscheduler/

# file size limit for upload
spring.servlet.multipart.max-file-size=1024MB
spring.servlet.multipart.max-request-size=1024MB

#post content
server.jetty.max-http-post-size=5000000

spring.messages.encoding=UTF-8

#i18n classpath folder , file prefix messages, if have many files, use "," seperator
spring.messages.basename=i18n/messages

server.is-combined-server=true
name: SonarCloud
on: [push, pull_request]
jobs:
  sonarCloudTrigger:
    name: SonarCloud Trigger
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions/setup-java@v1
      with:
        java-version: 8
    - uses: actions/cache@v1
      with:
        path: ~/.m2/repository
        key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-sonarqube
        restore-keys: |
          ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-sonarqube
          ${{ runner.os }}-maven-
    - name: Maven clean
      run: mvn clean
    - name: Run SonarCloud analyse
      run: >
          mvn clean --batch-mode
          org.jacoco:jacoco-maven-plugin:prepare-agent
          verify
          org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
          -Dmaven.test.skip=true
          -Dsonar.host.url=https://sonarcloud.io
          -Dsonar.organization=apache
          -Dsonar.projectKey=apache-dolphinscheduler
          -Dsonar.login=e4058004bc6be89decf558ac819aa1ecbee57682
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+2 −1
Original line number Diff line number Diff line
@@ -4,7 +4,8 @@ Dolphin Scheduler Official Website
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![Total Lines](https://tokei.rs/b1/github/apache/Incubator-DolphinScheduler?category=lines)](https://github.com/apache/Incubator-DolphinScheduler)
[![codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/branch/dev/graph/badge.svg)](https://codecov.io/gh/apache/incubator-dolphinscheduler/branch/dev)
![Codacy Badge](https://api.codacy.com/project/badge/Grade/ae514bfb7bb049658e916da091928e62)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apache-dolphinscheduler&metric=alert_status)](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler)


> Dolphin Scheduler for Big Data

+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ Dolphin Scheduler Official Website
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![Total Lines](https://tokei.rs/b1/github/apache/Incubator-DolphinScheduler?category=lines)](https://github.com/apache/Incubator-DolphinScheduler)
[![codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/branch/dev/graph/badge.svg)](https://codecov.io/gh/apache/incubator-dolphinscheduler/branch/dev)
![Codacy Badge](https://api.codacy.com/project/badge/Grade/ae514bfb7bb049658e916da091928e62)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apache-dolphinscheduler&metric=alert_status)](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler)

> Dolphin Scheduler for Big Data

+4 −7
Original line number Diff line number Diff line
@@ -39,20 +39,16 @@ public class AlertServer {

    private AlertSender alertSender;

    private static volatile AlertServer instance;
    private static AlertServer instance;

    public AlertServer() {

    }

    public static AlertServer getInstance(){
        if (null == instance) {
            synchronized (AlertServer.class) {
    public synchronized static AlertServer getInstance(){
        if (null == instance) {
            instance = new AlertServer();
        }
            }
        }
        return instance;
    }

@@ -63,6 +59,7 @@ public class AlertServer {
                Thread.sleep(Constants.ALERT_SCAN_INTERVEL);
            } catch (InterruptedException e) {
                logger.error(e.getMessage(),e);
                Thread.currentThread().interrupt();
            }
            List<Alert> alerts = alertDao.listWaitExecutionAlert();
            alertSender = new AlertSender(alerts, alertDao);
+31 −22
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ public class EnterpriseWeChatUtils {
        String resp;

        CloseableHttpClient httpClient = HttpClients.createDefault();
        try {
            HttpGet httpGet = new HttpGet(enterpriseWeChatTokenUrlReplace);
            CloseableHttpResponse response = httpClient.execute(httpGet);
            try {
@@ -100,6 +101,9 @@ public class EnterpriseWeChatUtils {
                    new TypeToken<Map<String, Object>>() {
                    }.getType());
            return map.get("access_token").toString();
        } finally {
            httpClient.close();
        }
    }

    /**
@@ -167,10 +171,11 @@ public class EnterpriseWeChatUtils {
    public static String sendEnterpriseWeChat(String charset, String data, String token) throws IOException {
        String enterpriseWeChatPushUrlReplace = enterpriseWeChatPushUrl.replaceAll("\\$token", token);

        CloseableHttpClient httpclient = HttpClients.createDefault();
        CloseableHttpClient httpClient = HttpClients.createDefault();
        try {
            HttpPost httpPost = new HttpPost(enterpriseWeChatPushUrlReplace);
            httpPost.setEntity(new StringEntity(data, charset));
        CloseableHttpResponse response = httpclient.execute(httpPost);
            CloseableHttpResponse response = httpClient.execute(httpPost);
            String resp;
            try {
                HttpEntity entity = response.getEntity();
@@ -179,8 +184,12 @@ public class EnterpriseWeChatUtils {
            } finally {
                response.close();
            }
        logger.info("Enterprise WeChat send [{}], param:{}, resp:{}", enterpriseWeChatPushUrl, data, resp);
            logger.info("Enterprise WeChat send [{}], param:{}, resp:{}", 
                enterpriseWeChatPushUrl, data, resp);
            return resp;
        } finally {
            httpClient.close();
        }
    }

    /**
Loading