Skip to content

Commit 0c5bc3e

Browse files
committed
add check for empty update
1 parent e733ae8 commit 0c5bc3e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

apps/threat-detection/src/main/java/com/akto/threat/detection/crons/ApiCountInfoRelayCron.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ public void run(){
5252

5353
// build api hit count payload and call cyborg
5454
List<ApiHitCountInfo> hitCountInfos = ApiCountInfoRelayUtils.buildPayload(keyValData);
55+
if (hitCountInfos == null || hitCountInfos.size() == 0) {
56+
logger.info("hitCountInfos is empty, returning");
57+
return;
58+
}
5559
try {
5660
dataActor.bulkInsertApiHitCount(hitCountInfos);
5761
cache.set(RedisKeyInfo.API_COUNTER_RELAY_LAST_UPDATE_TS, endBinId);

0 commit comments

Comments
 (0)