Skip to content

Commit 084eee0

Browse files
committed
feedback
1 parent ab64d08 commit 084eee0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

client/src/main/java/io/split/engine/segments/SegmentSynchronizationTaskImp.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
import java.io.Closeable;
1111
import java.util.List;
1212
import java.util.Map;
13-
import java.util.concurrent.*;
13+
import java.util.concurrent.ConcurrentMap;
14+
import java.util.concurrent.Executors;
15+
import java.util.concurrent.ScheduledExecutorService;
16+
import java.util.concurrent.ScheduledFuture;
17+
import java.util.concurrent.ThreadFactory;
18+
import java.util.concurrent.TimeUnit;
1419
import java.util.concurrent.atomic.AtomicBoolean;
1520
import java.util.concurrent.atomic.AtomicLong;
1621
import java.util.stream.Collectors;
@@ -54,7 +59,6 @@ public SegmentSynchronizationTaskImp(SegmentChangeFetcher segmentChangeFetcher,
5459

5560
@Override
5661
public void run() {
57-
_log.debug("Starting PeriodicFetching Segments ...");
5862
this.fetchAll(false);
5963
}
6064

@@ -104,6 +108,7 @@ public void startPeriodicFetching() {
104108
return;
105109
}
106110

111+
_log.debug("Starting PeriodicFetching Segments ...");
107112
_scheduledFuture = _scheduledExecutorService.scheduleWithFixedDelay(this, 0L, _refreshEveryNSeconds.get(), TimeUnit.SECONDS);
108113
}
109114

client/src/test/java/io/split/engine/experiments/SplitFetcherTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public void works_when_we_start_with_any_state() throws InterruptedException {
5454
private void works(long startingChangeNumber) throws InterruptedException {
5555
AChangePerCallSplitChangeFetcher splitChangeFetcher = new AChangePerCallSplitChangeFetcher();
5656
SDKReadinessGates gates = new SDKReadinessGates();
57-
gates.sdkInternalReady();
5857
SegmentCache segmentCache = new SegmentCacheInMemoryImpl();
5958
SegmentChangeFetcher segmentChangeFetcher = Mockito.mock(SegmentChangeFetcher.class);
6059
SegmentSynchronizationTask segmentSynchronizationTask = new SegmentSynchronizationTaskImp(segmentChangeFetcher,1,10, gates, segmentCache);
@@ -86,7 +85,6 @@ private void works(long startingChangeNumber) throws InterruptedException {
8685
@Test
8786
public void when_parser_fails_we_remove_the_experiment() throws InterruptedException {
8887
SDKReadinessGates gates = new SDKReadinessGates();
89-
gates.sdkInternalReady();
9088
Split validSplit = new Split();
9189
validSplit.status = Status.ACTIVE;
9290
validSplit.seed = (int) -1;
@@ -147,7 +145,6 @@ public void when_parser_fails_we_remove_the_experiment() throws InterruptedExcep
147145
@Test
148146
public void if_there_is_a_problem_talking_to_split_change_count_down_latch_is_not_decremented() throws Exception {
149147
SDKReadinessGates gates = new SDKReadinessGates();
150-
gates.sdkInternalReady();
151148
SplitCache cache = new InMemoryCacheImp(-1);
152149

153150
SplitChangeFetcher splitChangeFetcher = mock(SplitChangeFetcher.class);
@@ -191,7 +188,6 @@ public void works_with_user_defined_segments() throws Exception {
191188
String segmentName = "foosegment";
192189
AChangePerCallSplitChangeFetcher experimentChangeFetcher = new AChangePerCallSplitChangeFetcher(segmentName);
193190
SDKReadinessGates gates = new SDKReadinessGates();
194-
gates.sdkInternalReady();
195191
SplitCache cache = new InMemoryCacheImp(startingChangeNumber);
196192
SegmentCache segmentCache = new SegmentCacheInMemoryImpl();
197193

0 commit comments

Comments
 (0)