Skip to content

Commit 89502c4

Browse files
committed
Removed recursion possibility for enrichments if failure occurs
1 parent 86d8593 commit 89502c4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

codegen.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4792,19 +4792,19 @@ func handleRunDatastoreAutomation(cacheData CacheKeyData, automation DatastoreAu
47924792
}
47934793

47944794
// Set cache key for 1 hour to avoid re-running enrich too often
4795-
SetCache(ctx, cacheKey, []byte("1"), 5)
4795+
SetCache(ctx, cacheKey, []byte("1"), 15)
47964796

47974797
// Use key "enrichments" =>
47984798
// [{"name": "answers.ip", "value": "92.24.47.250", "type": "location", "data": {"city": "Socotra", "continent": "Asia", "coordinates": [-25.4153, 17.0743], "country": "YE", "desc": "Yemen"}}]
47994799

48004800
parsedData := map[string]interface{}{}
48014801
if err := json.Unmarshal(marshalledBody, &parsedData); err != nil {
4802-
log.Printf("[WARNING] Failed to unmarshal marshalledBody for enrich for key %s in category %s: %s", cacheData.Key, cacheData.Category, err)
4802+
//log.Printf("[WARNING] Failed to unmarshal marshalledBody for enrich for key %s in category %s: %s", cacheData.Key, cacheData.Category, err)
48034803
return err
48044804
}
48054805

48064806
if _, ok := parsedData["enrichments"]; ok {
4807-
log.Printf("[DEBUG] Enrichments key already exists - skipping enrichment automation for key %s in category %s", cacheData.Key, cacheData.Category)
4807+
//log.Printf("[DEBUG] Enrichments key already exists - skipping enrichment automation for key %s in category %s", cacheData.Key, cacheData.Category)
48084808
return nil
48094809
}
48104810

@@ -4836,7 +4836,7 @@ func handleRunDatastoreAutomation(cacheData CacheKeyData, automation DatastoreAu
48364836
}
48374837

48384838
// Send the data into shuffle_tools => parse_ioc?
4839-
// Or generate a subflow that runs for it? :thinking:
4839+
// Or generate a workflow that runs for it? :thinking:
48404840

48414841
// Example process:
48424842
// 1. Ingest IOC (hash/IP/domain/alert) => inject into datastore category

0 commit comments

Comments
 (0)