Skip to content

Commit

Permalink
Merge pull request #552 from akto-api-security/revert-512-hotfix/last…
Browse files Browse the repository at this point in the history
…_seen_har

Revert "allow merging to happen after har upload"
  • Loading branch information
avneesh-akto authored Sep 6, 2023
2 parents d78f4ed + c1beb41 commit 57cec56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,22 @@ public class APICatalogSync {
public Map<Integer, APICatalog> dbState;
public Map<Integer, APICatalog> delta;
public Map<SensitiveParamInfo, Boolean> sensitiveParamInfoBooleanMap;
public static boolean mergeAsyncOutside = true;
public static boolean mergeAsyncOutside = false;

public APICatalogSync(String userIdentifier,int thresh) {
this.thresh = thresh;
this.userIdentifier = userIdentifier;
this.dbState = new HashMap<>();
this.delta = new HashMap<>();
this.sensitiveParamInfoBooleanMap = new HashMap<>();
try {
String instanceType = System.getenv("AKTO_INSTANCE_TYPE");
if (instanceType != null && "RUNTIME".equalsIgnoreCase(instanceType)) {
mergeAsyncOutside = AccountSettingsDao.instance.findOne(AccountSettingsDao.generateFilter()).getMergeAsyncOutside();
}
} catch (Exception e) {

}

}

Expand Down Expand Up @@ -1153,8 +1161,7 @@ public static URLTemplate createUrlTemplate(String url, Method method) {
public void buildFromDB(boolean calcDiff, boolean fetchAllSTI) {

loggerMaker.infoAndAddToDb("Started building from dB", LogDb.RUNTIME);
String instanceType = System.getenv("AKTO_INSTANCE_TYPE");
if (mergeAsyncOutside && instanceType != null && "RUNTIME".equalsIgnoreCase(instanceType) ) {
if (mergeAsyncOutside) {
if (Context.now() - lastMergeAsyncOutsideTs > 600) {
this.lastMergeAsyncOutsideTs = Context.now();

Expand Down
2 changes: 0 additions & 2 deletions apps/dashboard/src/main/java/com/akto/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.akto.log.LoggerMaker;
import com.akto.log.LoggerMaker.LogDb;
import com.akto.parsers.HttpCallParser;
import com.akto.runtime.APICatalogSync;
import com.akto.runtime.policies.AktoPolicyNew;
import com.akto.testing.ApiExecutor;
import com.fasterxml.jackson.databind.JsonNode;
Expand Down Expand Up @@ -328,7 +327,6 @@ public static void pushDataToKafka(int apiCollectionId, String topic, List<Strin

info.getHttpCallParser().syncFunction(responses, true, false);
info.getPolicy().main(responses, true, false);
APICatalogSync.mergeUrlsAndSave(apiCollectionId,true);
}
}

Expand Down

0 comments on commit 57cec56

Please sign in to comment.