9
9
10
10
public class ConfigurationRequestor {
11
11
private static final Logger log = LoggerFactory .getLogger (ConfigurationRequestor .class );
12
- private static final String FLAG_CONFIG_PATH = "/api/flag-config/v1/config" ;
13
- private static final String BANDIT_PARAMETER_PATH = "/api/flag-config/v1/bandits" ;
14
12
15
13
private final EppoHttpClient client ;
16
14
private final IConfigurationStore configurationStore ;
@@ -90,13 +88,13 @@ void fetchAndSaveFromRemote() {
90
88
// Reuse the `lastConfig` as its bandits may be useful
91
89
Configuration lastConfig = configurationStore .getConfiguration ();
92
90
93
- byte [] flagConfigurationJsonBytes = client .get (FLAG_CONFIG_PATH );
91
+ byte [] flagConfigurationJsonBytes = client .get (Constants . FLAG_CONFIG_ENDPOINT );
94
92
Configuration .Builder configBuilder =
95
93
Configuration .builder (flagConfigurationJsonBytes , expectObfuscatedConfig )
96
94
.banditParametersFromConfig (lastConfig );
97
95
98
96
if (supportBandits && configBuilder .requiresUpdatedBanditModels ()) {
99
- byte [] banditParametersJsonBytes = client .get (BANDIT_PARAMETER_PATH );
97
+ byte [] banditParametersJsonBytes = client .get (Constants . BANDIT_ENDPOINT );
100
98
configBuilder .banditParameters (banditParametersJsonBytes );
101
99
}
102
100
@@ -116,7 +114,7 @@ CompletableFuture<Void> fetchAndSaveFromRemoteAsync() {
116
114
117
115
remoteFetchFuture =
118
116
client
119
- .getAsync (FLAG_CONFIG_PATH )
117
+ .getAsync (Constants . FLAG_CONFIG_ENDPOINT )
120
118
.thenApply (
121
119
flagConfigJsonBytes -> {
122
120
synchronized (this ) {
@@ -128,7 +126,8 @@ CompletableFuture<Void> fetchAndSaveFromRemoteAsync() {
128
126
if (supportBandits && configBuilder .requiresUpdatedBanditModels ()) {
129
127
byte [] banditParametersJsonBytes ;
130
128
try {
131
- banditParametersJsonBytes = client .getAsync (BANDIT_PARAMETER_PATH ).get ();
129
+ banditParametersJsonBytes =
130
+ client .getAsync (Constants .BANDIT_ENDPOINT ).get ();
132
131
} catch (InterruptedException | ExecutionException e ) {
133
132
log .error ("Error fetching from remote: " + e .getMessage ());
134
133
throw new RuntimeException (e );
0 commit comments