Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 0b845b1

Browse files
author
Samuel Hassine
committed
[client] Fix helper with last client ID
1 parent 7385101 commit 0b845b1

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

pycti/connector/opencti_connector_helper.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,16 @@ def get_range(self, from_id):
222222
return result["lastEventId"]
223223

224224
def run(self):
225-
from_event_id = self.connector_last_event_id
226-
from_event_timestamp = 0
227-
last_event_timestamp = int(self.last_event_id.split("-")[0])
228-
while (
229-
from_event_timestamp <= last_event_timestamp
230-
and from_event_id != self.last_event_id
231-
):
232-
from_event_id = self.get_range(from_event_id)
233-
from_event_timestamp = int(from_event_id.split("-")[0])
225+
if self.connector_last_event_id:
226+
from_event_id = self.connector_last_event_id
227+
from_event_timestamp = 0
228+
last_event_timestamp = int(self.last_event_id.split("-")[0])
229+
while (
230+
from_event_timestamp <= last_event_timestamp
231+
and from_event_id != self.last_event_id
232+
):
233+
from_event_id = self.get_range(from_event_id)
234+
from_event_timestamp = int(from_event_id.split("-")[0])
234235
logging.info("Events catchup requests done.")
235236

236237

0 commit comments

Comments
 (0)