summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/srht_contrib/jobs/poller.py3
-rw-r--r--src/srht_contrib/services/git.py3
-rw-r--r--src/srht_contrib/services/todo.py3
3 files changed, 6 insertions, 3 deletions
diff --git a/src/srht_contrib/jobs/poller.py b/src/srht_contrib/jobs/poller.py
index 2b00090..45992e4 100644
--- a/src/srht_contrib/jobs/poller.py
+++ b/src/srht_contrib/jobs/poller.py
@@ -1,5 +1,6 @@
from __future__ import annotations
+import copy
import logging
from datetime import UTC, datetime, timedelta
@@ -224,7 +225,7 @@ class PollerService:
result = fetcher(actor=actor, cursor_state=state.cursor_json)
inserted = self._insert_events(db, result.events)
total_inserted += inserted
- state.cursor_json = result.cursor_state
+ state.cursor_json = copy.deepcopy(result.cursor_state)
state.last_error = None
state.updated_at = datetime.now(tz=UTC)
if result.complete:
diff --git a/src/srht_contrib/services/git.py b/src/srht_contrib/services/git.py
index 69a6c1c..ebb823e 100644
--- a/src/srht_contrib/services/git.py
+++ b/src/srht_contrib/services/git.py
@@ -1,5 +1,6 @@
from __future__ import annotations
+import copy
from dataclasses import dataclass
from datetime import UTC, datetime, timedelta
import logging
@@ -131,7 +132,7 @@ class GitIngestionService:
"current_repository": None,
}
if cursor_state:
- state.update(cursor_state)
+ state.update(copy.deepcopy(cursor_state))
if not state["discovery_complete"]:
data = self.client.execute(
diff --git a/src/srht_contrib/services/todo.py b/src/srht_contrib/services/todo.py
index 0142005..b7209b1 100644
--- a/src/srht_contrib/services/todo.py
+++ b/src/srht_contrib/services/todo.py
@@ -1,5 +1,6 @@
from __future__ import annotations
+import copy
from dataclasses import dataclass
from datetime import UTC, datetime, timedelta
import logging
@@ -303,7 +304,7 @@ class TodoIngestionService:
"trackers_loaded": False,
}
if cursor_state:
- state.update(cursor_state)
+ state.update(copy.deepcopy(cursor_state))
if not state["trackers_loaded"]:
data = self.client.execute(TODO_TRACKERS_QUERY, {"cursor": state["trackers_cursor"]})