From e758e7c7bbc9a154456e7dba360bd4861e94b95c Mon Sep 17 00:00:00 2001 From: pangdayuan Date: Mon, 16 Oct 2023 19:54:13 +0800 Subject: [PATCH] feat: add ignore.time.precision.millis --- arex-schedule-web-api/pom.xml | 4 ++-- .../schedule/comparer/impl/DefaultReplayResultComparer.java | 5 ++++- .../src/main/resources/application.properties | 3 ++- pom.xml | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/arex-schedule-web-api/pom.xml b/arex-schedule-web-api/pom.xml index e1467cbf2..2655f4291 100644 --- a/arex-schedule-web-api/pom.xml +++ b/arex-schedule-web-api/pom.xml @@ -6,11 +6,11 @@ com.arextest arex-schedule-parent - 1.0.38.4 + 1.0.38.5 ${packagingType} arex-schedule-web-api - 1.0.38.4 + 1.0.38.5 ${project.groupId}:${project.artifactId} diff --git a/arex-schedule-web-api/src/main/java/com/arextest/schedule/comparer/impl/DefaultReplayResultComparer.java b/arex-schedule-web-api/src/main/java/com/arextest/schedule/comparer/impl/DefaultReplayResultComparer.java index 8852150d2..31f084b95 100644 --- a/arex-schedule-web-api/src/main/java/com/arextest/schedule/comparer/impl/DefaultReplayResultComparer.java +++ b/arex-schedule-web-api/src/main/java/com/arextest/schedule/comparer/impl/DefaultReplayResultComparer.java @@ -25,6 +25,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; import org.springframework.util.StopWatch; +import org.springframework.beans.factory.annotation.Value; import java.util.ArrayList; import java.util.Base64; @@ -48,9 +49,11 @@ public class DefaultReplayResultComparer implements ReplayResultComparer { private static final int INDEX_NOT_FOUND = -1; private static final CompareSDK COMPARE_INSTANCE = new CompareSDK(); private static final long MAX_TIME = Long.MAX_VALUE; + @Value("${ignore.time.precision.millis}") + private static long ignoreTimePrecisionMillis; static { - COMPARE_INSTANCE.getGlobalOptions().putNameToLower(true).putNullEqualsEmpty(true).putIgnoredTimePrecision(1000); + COMPARE_INSTANCE.getGlobalOptions().putNameToLower(true).putNullEqualsEmpty(true).putIgnoredTimePrecision(ignoreTimePrecisionMillis); } public static CompareSDK getCompareSDKInstance() { diff --git a/arex-schedule-web-api/src/main/resources/application.properties b/arex-schedule-web-api/src/main/resources/application.properties index 3ba3e4082..124d5b239 100644 --- a/arex-schedule-web-api/src/main/resources/application.properties +++ b/arex-schedule-web-api/src/main/resources/application.properties @@ -43,4 +43,5 @@ arex.client.https.cert.disable=true arex.prometheus.port=20092 -arex.app.auth.switch=true \ No newline at end of file +arex.app.auth.switch=true +ignore.time.precision.millis=2000 \ No newline at end of file diff --git a/pom.xml b/pom.xml index 06726458c..255f23f34 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.arextest arex-schedule-parent - 1.0.38.4 + 1.0.38.5 ${project.groupId}:${project.artifactId}