Skip to content

Commit

Permalink
Waiting for the cache scheduler termination.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihajlovski committed Mar 19, 2017
1 parent 5ae40eb commit 59dd626
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -27,6 +27,7 @@
import org.rapidoid.cache.impl.CacheStats;
import org.rapidoid.cache.impl.ConcurrentCacheAtomWithStats;
import org.rapidoid.lambda.Mapper;
import org.rapidoid.u.U;
import org.rapidoid.util.LazyInit;

import java.util.concurrent.Callable;
Expand Down Expand Up @@ -65,6 +66,8 @@ public static void reset() {
}

public static void shutdown() {
scheduler().shutdownNow();
ScheduledThreadPoolExecutor scheduler = scheduler();
scheduler.shutdownNow();
while (!scheduler.isTerminated()) U.sleep(1);
}
}

0 comments on commit 59dd626

Please sign in to comment.