Skip to content

Commit

Permalink
fix timeout of tif job creation
Browse files Browse the repository at this point in the history
Signed-off-by: Surya Sashank Nistala <[email protected]>
  • Loading branch information
eirsep committed Oct 21, 2023
1 parent a5136bf commit 24a7e51
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,23 @@ public void deleteThreatIntelDataIndex(final List<String> indices) {

private void createThreatIntelFeedData() throws InterruptedException {
CountDownLatch countDownLatch = new CountDownLatch(1);
client.execute(PutTIFJobAction.INSTANCE, new PutTIFJobRequest("feed_updater", clusterSettings.get(SecurityAnalyticsSettings.TIF_UPDATE_INTERVAL))).actionGet();
client.execute(
PutTIFJobAction.INSTANCE,
new PutTIFJobRequest("feed_updater", clusterSettings.get(SecurityAnalyticsSettings.TIF_UPDATE_INTERVAL)),
new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(AcknowledgedResponse acknowledgedResponse) {
log.debug("Acknowledged threat intel feed updater job created");
countDownLatch.countDown();
}

@Override
public void onFailure(Exception e) {
log.debug("Failed to create threat intel feed updater job", e);
countDownLatch.countDown();
}
}
);
countDownLatch.await();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ public void testCreateDetectorWithThreatIntelEnabled_updateDetectorWithThreatInt
List<String> iocs = getThreatIntelFeedIocs(3);
int i=1;
for (String ioc : iocs) {
indexDoc(index, i+"", randomDocWithIpIoc(5, 3, i==1? "120.85.114.146" : "120.86.237.94"));
indexDoc(index, i + "", randomDocWithIpIoc(5, 3, ioc));
i++;
}
String workflowId = ((List<String>) detectorMap.get("workflow_ids")).get(0);
Expand Down

0 comments on commit 24a7e51

Please sign in to comment.