Skip to content

Commit

Permalink
fix: alert compute await (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
masaimu authored Oct 18, 2023
1 parent 2a61af9 commit 47a49e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

/**
* http DataCollection proxy
Expand Down Expand Up @@ -149,7 +150,7 @@ public void handle(XHttpResponse rep) {
latch.countDown();
}
});
latch.await();
latch.await(30, TimeUnit.SECONDS);
if (optional.sucess) {
logger.info("http request[" + request + "] cost " + (System.currentTimeMillis() - start)
+ "ms, code[" + optional.response.code + "].");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public EventInfo runRule(InspectConfig inspectConfig, long period,
}
});
}
latch.await();
latch.await(30, TimeUnit.SECONDS);
if (triggerResults.size() != 0) {
triggerMap.put(trigger, triggerResults);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ protected List<EventInfo> calculate(ComputeTaskPackage computeTaskPackage) {
RecordSucOrFailNotify.alertNotifyProcessSuc(ALERT_TASK_COMPUTE, "alert task compute",
inspectConfig.getAlertNotifyRecord());
}
latch.await();
latch.await(30, TimeUnit.SECONDS);
if (!CollectionUtils.isEmpty(alertNotifyRecordDTOList)) {
RecordSucOrFailNotify.batchInsert(alertNotifyRecordDTOList);
}
Expand Down

0 comments on commit 47a49e8

Please sign in to comment.