Showing
1 changed file
with
2 additions
and
15 deletions
@@ -55,21 +55,8 @@ public class HttpClient { | @@ -55,21 +55,8 @@ public class HttpClient { | ||
55 | private CloseableHttpClient httpClient; | 55 | private CloseableHttpClient httpClient; |
56 | 56 | ||
57 | @PostConstruct | 57 | @PostConstruct |
58 | - public void init() { | ||
59 | - new Thread(() -> { | ||
60 | - while (Objects.isNull(httpClient)) { | ||
61 | - try { | ||
62 | - httpClient = this.buildHttpClient(); | ||
63 | - } catch (Exception e) { | ||
64 | - log.warn("build http client fail, {}", e.getMessage()); | ||
65 | - } | ||
66 | - try { | ||
67 | - Thread.sleep(3 * 1000); | ||
68 | - } catch (InterruptedException e) { | ||
69 | - | ||
70 | - } | ||
71 | - } | ||
72 | - }, "http-client-builder-" + this.getClass().getSimpleName()).start(); | 58 | + public void init() throws Exception { |
59 | + httpClient = this.buildHttpClient(); | ||
73 | } | 60 | } |
74 | 61 | ||
75 | public CloseableHttpClient buildHttpClient() throws Exception { | 62 | public CloseableHttpClient buildHttpClient() throws Exception { |
-
Please register or login to post a comment