Commit ff4b8faf authored by 董建华's avatar 董建华

调整加载策略

parent 16f1158d
......@@ -11,7 +11,7 @@
</parent>
<groupId>cn.quantgroup</groupId>
<artifactId>spring-boot-starter-sentry-ext</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.2-SNAPSHOT</version>
<name>spring-boot-starter-sentry-ext</name>
<description>sentry超时的时候可选钉钉备用</description>
<packaging>jar</packaging>
......
......@@ -12,6 +12,7 @@ import io.sentry.SentryClientFactory;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
......@@ -25,6 +26,9 @@ import org.springframework.context.annotation.Configuration;
* @version:
*/
@Slf4j
@ConditionalOnProperty(
name = {"sentry.dsn","threrr"}
)
@Configuration
@EnableConfigurationProperties({SentryProperties.class,ThrErrProProperties.class})
public class SentryDingdingConfiguration {
......@@ -34,12 +38,14 @@ public class SentryDingdingConfiguration {
@Autowired
private ThrErrProProperties thrErrProProperties;
/**
* 注入不用是保证先初始化SentryClient
*/
@Autowired
private SentryClient sentryClient;
@ConfigurationProperties(
prefix = "threrr"
@ConditionalOnProperty(
name = {"sentry.dsn","threrr"}
)
@Bean("thrErrSentryClient")
public SentryClient thrErrSentryClient() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment