|
1 | 1 | /**
|
2 | 2 | *
|
3 |
| - * Copyright 2019,2021, Optimizely |
| 3 | + * Copyright 2019, 2021, 2023, Optimizely |
4 | 4 | *
|
5 | 5 | * Licensed under the Apache License, Version 2.0 (the "License");
|
6 | 6 | * you may not use this file except in compliance with the License.
|
|
16 | 16 | */
|
17 | 17 | package com.optimizely.ab.config;
|
18 | 18 |
|
19 |
| -import com.optimizely.ab.HttpClientUtils; |
20 | 19 | import com.optimizely.ab.OptimizelyHttpClient;
|
21 | 20 | import com.optimizely.ab.annotations.VisibleForTesting;
|
22 | 21 | import com.optimizely.ab.config.parser.ConfigParseException;
|
23 | 22 | import com.optimizely.ab.internal.PropertyUtils;
|
24 | 23 | import com.optimizely.ab.notification.NotificationCenter;
|
25 |
| -import com.optimizely.ab.optimizelyconfig.OptimizelyConfig; |
26 | 24 | import org.apache.http.*;
|
27 | 25 | import org.apache.http.client.ClientProtocolException;
|
28 | 26 | import org.apache.http.client.methods.CloseableHttpResponse;
|
29 | 27 | import org.apache.http.client.methods.HttpGet;
|
30 |
| -import org.apache.http.impl.client.CloseableHttpClient; |
31 | 28 | import org.apache.http.util.EntityUtils;
|
32 | 29 | import org.slf4j.Logger;
|
33 | 30 | import org.slf4j.LoggerFactory;
|
@@ -148,6 +145,16 @@ protected ProjectConfig poll() {
|
148 | 145 | return null;
|
149 | 146 | }
|
150 | 147 |
|
| 148 | + @Override |
| 149 | + public synchronized void close() { |
| 150 | + super.close(); |
| 151 | + try { |
| 152 | + httpClient.close(); |
| 153 | + } catch (IOException e) { |
| 154 | + e.printStackTrace(); |
| 155 | + } |
| 156 | + } |
| 157 | + |
151 | 158 | @VisibleForTesting
|
152 | 159 | HttpGet createHttpRequest() {
|
153 | 160 | HttpGet httpGet = new HttpGet(uri);
|
|
0 commit comments