From 8fc99f85140692508c16724e80e8768313b8ea85 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Fri, 30 Oct 2020 15:58:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=E5=88=A4=E6=96=AD=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E6=98=AFldaps=E4=B8=8D=E5=8C=BA=E5=88=86=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/io/metersphere/ldap/service/LdapService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/ldap/service/LdapService.java b/backend/src/main/java/io/metersphere/ldap/service/LdapService.java index 44aa6bc84a..a735e3122d 100644 --- a/backend/src/main/java/io/metersphere/ldap/service/LdapService.java +++ b/backend/src/main/java/io/metersphere/ldap/service/LdapService.java @@ -147,7 +147,7 @@ public class LdapService { String credentials = EncryptUtils.aesDecrypt(password).toString(); LdapContextSource sourceLdapCtx; - if (StringUtils.startsWith(url, "ldaps://")) { + if (StringUtils.startsWithIgnoreCase(url, "ldaps://")) { sourceLdapCtx = new SSLLdapContextSource(); // todo 这里加上strategy 会报错 // DefaultTlsDirContextAuthenticationStrategy strategy = new DefaultTlsDirContextAuthenticationStrategy(); From d5f231bf325e00451a8fbc949668d1a2631b4bcc Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Mon, 2 Nov 2020 13:20:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=8A=A5=E5=91=8A=E4=B8=8D?= =?UTF-8?q?=E5=8F=91=E9=80=81=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 45344632163c7207d65cd29b6ab109b5216989de) --- .../performance/notice/PerformanceNoticeTask.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/performance/notice/PerformanceNoticeTask.java b/backend/src/main/java/io/metersphere/performance/notice/PerformanceNoticeTask.java index 3eeb70d0f9..2daeca53a3 100644 --- a/backend/src/main/java/io/metersphere/performance/notice/PerformanceNoticeTask.java +++ b/backend/src/main/java/io/metersphere/performance/notice/PerformanceNoticeTask.java @@ -1,6 +1,7 @@ package io.metersphere.performance.notice; import io.metersphere.base.domain.LoadTestReportWithBLOBs; +import io.metersphere.base.mapper.LoadTestReportMapper; import io.metersphere.commons.constants.NoticeConstants; import io.metersphere.commons.constants.PerformanceTestStatus; import io.metersphere.commons.utils.LogUtil; @@ -34,6 +35,9 @@ public class PerformanceNoticeTask { private MailService mailService; @Resource private SystemParameterService systemParameterService; + @Resource + private LoadTestReportMapper loadTestReportMapper; + private final ExecutorService executorService = Executors.newFixedThreadPool(20); private boolean isRunning = true; @@ -45,14 +49,16 @@ public class PerformanceNoticeTask { public void registerNoticeTask(LoadTestReportWithBLOBs loadTestReport) { executorService.submit(() -> { while (isRunning) { - if (StringUtils.equals(loadTestReport.getStatus(), PerformanceTestStatus.Completed.name())) { + LoadTestReportWithBLOBs loadTestReportFromDatabase = loadTestReportMapper.selectByPrimaryKey(loadTestReport.getId()); + + if (StringUtils.equals(loadTestReportFromDatabase.getStatus(), PerformanceTestStatus.Completed.name())) { isRunning = false; - sendSuccessNotice(loadTestReport); + sendSuccessNotice(loadTestReportFromDatabase); return; } - if (StringUtils.equals(loadTestReport.getStatus(), PerformanceTestStatus.Error.name())) { + if (StringUtils.equals(loadTestReportFromDatabase.getStatus(), PerformanceTestStatus.Error.name())) { isRunning = false; - sendFailNotice(loadTestReport); + sendFailNotice(loadTestReportFromDatabase); return; } try {