From 2f380cae9a1abef566c14b2b307e02c0b5d9a1c4 Mon Sep 17 00:00:00 2001 From: Sascha Steinbiss Date: Mon, 30 Aug 2021 15:20:41 +0200 Subject: [PATCH 1/2] make sure to pass sequence parameter to fetch method --- bin/tie2index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tie2index.py b/bin/tie2index.py index 5a276ca..268d480 100644 --- a/bin/tie2index.py +++ b/bin/tie2index.py @@ -104,7 +104,7 @@ def fetch_iocs() -> NoReturn: logger.info("fetching IoCs using sequence number {}".format(fetcher.state['seq_number'])) i = 0 - data = fetcher.fetch(updated_since=updated_since, limit=10) + data = fetcher.fetch(sequence=fetcher.state['seq_number'], updated_since=updated_since, limit=10) try: while i < 50: i += 1 From d81b95e5f7a292bdd27f4d809e5d8d05b2353878 Mon Sep 17 00:00:00 2001 From: Sascha Steinbiss Date: Mon, 30 Aug 2021 15:21:07 +0200 Subject: [PATCH 2/2] store maximum seen sequence number as new query start --- lib/dcsotie/fetchers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dcsotie/fetchers.py b/lib/dcsotie/fetchers.py index f67120b..05f5155 100644 --- a/lib/dcsotie/fetchers.py +++ b/lib/dcsotie/fetchers.py @@ -108,7 +108,7 @@ def _fetch(self, uri: str, params: Optional[Dict] = None) -> Any: # store highest sequence if len(data['iocs']) > 0: - self.state['seq_number'] = sorted([ioc['min_seq'] for ioc in data['iocs']])[-1] + self.state['seq_number'] = sorted([ioc['max_seq'] for ioc in data['iocs']])[-1] try: if self._raw: