This repository was archived by the owner on Dec 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -769,6 +769,9 @@ class TimeUnit(Enum):
769769 def __init__ (self , config : Dict , playbook_compatible = False ) -> None :
770770 sys .excepthook = killProgramHook
771771
772+ # Cache
773+ self .stream_collections = {}
774+
772775 # Load API config
773776 self .config = config
774777 self .opencti_url = get_config_variable (
@@ -1063,6 +1066,9 @@ def get_stream_collection(self):
10631066 "stream_live" : True ,
10641067 "stream_public" : False ,
10651068 }
1069+ # Get from cache
1070+ elif self .connect_live_stream_id in self .stream_collections :
1071+ return self .stream_collections [self .connect_live_stream_id ]
10661072 else :
10671073 query = """
10681074 query StreamCollection($id: String!) {
@@ -1076,6 +1082,10 @@ def get_stream_collection(self):
10761082 }
10771083 """
10781084 result = self .api .query (query , {"id" : self .connect_live_stream_id })
1085+ # Put in cache
1086+ self .stream_collections [self .connect_live_stream_id ] = result ["data" ][
1087+ "streamCollection"
1088+ ]
10791089 return result ["data" ]["streamCollection" ]
10801090 else :
10811091 raise ValueError ("This connector is not connected to any stream" )
You can’t perform that action at this time.
0 commit comments