Skip to content

Commit 0974d41

Browse files
committed
Add assert
1 parent 29936f5 commit 0974d41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderTaskExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public void init() {
139139

140140
@FixForMultiProject(description = "Should execute in the context of the current project after settings are project-aware")
141141
private void setEnabled(boolean enabled) {
142+
assert projectResolver.getProjectId() != null : "projectId must be set before enabling download";
142143
if (clusterService.state().nodes().isLocalNodeElectedMaster() == false) {
143144
// we should only start/stop task from single node, master is the best as it will go through it anyway
144145
return;
@@ -402,7 +403,6 @@ private static boolean isForeachProcessorWithGeoipProcessor(Map<String, Object>
402403

403404
// starts GeoIP downloader task for a single project
404405
private void startTask(ProjectId projectId, Runnable onFailure) {
405-
assert projectId != null : "projectId must be set before starting geoIp download task";
406406
persistentTasksService.sendProjectStartRequest(
407407
projectId,
408408
getTaskId(projectId, projectResolver.supportsMultipleProjects()),

0 commit comments

Comments
 (0)