Skip to content

Commit

Permalink
Add legacy message
Browse files Browse the repository at this point in the history
  • Loading branch information
nmayorsplit committed Sep 1, 2023
1 parent bd15faa commit 06ed6e4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/src/main/java/io/split/client/SplitFactoryImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@

public class SplitFactoryImpl implements SplitFactory {
private static final Logger _log = LoggerFactory.getLogger(SplitFactory.class);
private static final String LEGACY_LOG_MESSAGE = "The sdk initialize in localhost mode using Legacy file. The splitFile or inputStream doesn't add it to the config.";
private final static long SSE_CONNECT_TIMEOUT = 30000;
private final static long SSE_SOCKET_TIMEOUT = 70000;

Expand Down Expand Up @@ -645,17 +646,17 @@ private SplitChangeFetcher createSplitChangeFetcher(SplitClientConfig splitClien
FileTypeEnum fileType = splitClientConfig.fileType();
if (splitFile != null && inputStream != null) {
_log.warn("splitFile or inputStreamProvider should have a value, not both");
_log.warn("The sdk initialize in localhost mode using Legacy file. The splitFile or inputStream doesn't add it to the config.");
_log.warn(LEGACY_LOG_MESSAGE);
return new LegacyLocalhostSplitChangeFetcher(splitFile);
}
if (inputStream != null && fileType == null) {
_log.warn("If inputStreamProvider is not null, then fileType must also have a non-null value");
_log.warn("The sdk initialize in localhost mode using Legacy file. The splitFile or inputStream doesn't add it to the config.");
_log.warn(LEGACY_LOG_MESSAGE);
return new LegacyLocalhostSplitChangeFetcher(splitFile);
}
if (inputStream == null && splitFile == null){
_log.warn("splitFile or inputStreamProvider should have a value");
_log.warn("The sdk initialize in localhost mode using Legacy file. The splitFile or inputStream doesn't add it to the config.");
_log.warn(LEGACY_LOG_MESSAGE);
return new LegacyLocalhostSplitChangeFetcher(splitFile);
}
if (splitFile != null) {
Expand Down Expand Up @@ -684,7 +685,7 @@ private SplitChangeFetcher createSplitChangeFetcher(SplitClientConfig splitClien
return new LegacyLocalhostSplitChangeFetcher(splitFile);
}
}
_log.warn("The sdk initialize in localhost mode using Legacy file. The splitFile or inputStream doesn't add it to the config.");
_log.warn(LEGACY_LOG_MESSAGE);
return new LegacyLocalhostSplitChangeFetcher(splitFile);
}
}

0 comments on commit 06ed6e4

Please sign in to comment.