Skip to content

Commit 62a2892

Browse files
Cleanup IndicesService#CacheCleaner Scheduling (#42060) (#43528)
* Follow up to #42016
1 parent 3d5e457 commit 62a2892

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
@@ -65,7 +65,6 @@
6565
import org.elasticsearch.common.util.BigArrays;
6666
import org.elasticsearch.common.util.concurrent.AbstractRefCounted;
6767
import org.elasticsearch.common.util.concurrent.EsExecutors;
68-
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
6968
import org.elasticsearch.common.util.iterable.Iterables;
7069
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
7170
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
@@ -1226,13 +1225,7 @@ public void run() {
12261225
}
12271226
// Reschedule itself to run again if not closed
12281227
if (closed.get() == false) {
1229-
try {
1230-
threadPool.schedule(this, interval, ThreadPool.Names.SAME);
1231-
} catch (EsRejectedExecutionException e) {
1232-
if (closed.get() == false) {
1233-
throw e;
1234-
}
1235-
}
1228+
threadPool.scheduleUnlessShuttingDown(interval, ThreadPool.Names.SAME, this);
12361229
}
12371230
}
12381231

0 commit comments

Comments
 (0)