Skip to content

Commit 119faee

Browse files
Cleanup IndicesService#CacheCleaner Scheduling (#42060)
* Follow up to #42016
1 parent 893c50f commit 119faee

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

server/src/main/java/org/elasticsearch/indices/IndicesService.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
import org.elasticsearch.common.util.Maps;
6767
import org.elasticsearch.common.util.concurrent.AbstractRefCounted;
6868
import org.elasticsearch.common.util.concurrent.EsExecutors;
69-
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
7069
import org.elasticsearch.common.util.iterable.Iterables;
7170
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
7271
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
@@ -1220,13 +1219,7 @@ public void run() {
12201219
}
12211220
// Reschedule itself to run again if not closed
12221221
if (closed.get() == false) {
1223-
try {
1224-
threadPool.schedule(this, interval, ThreadPool.Names.SAME);
1225-
} catch (EsRejectedExecutionException e) {
1226-
if (closed.get() == false) {
1227-
throw e;
1228-
}
1229-
}
1222+
threadPool.scheduleUnlessShuttingDown(interval, ThreadPool.Names.SAME, this);
12301223
}
12311224
}
12321225

0 commit comments

Comments
 (0)