summaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/importers/common.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-04-18 16:23:09 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-04-18 16:23:09 -0700
commita14d851ad230b3adb569ec6ca112cd4d9e638b2c (patch)
tree30d3ccea7dc43d53b8862899a7009b75b59cfb48 /python/fatcat_tools/importers/common.py
parentbfc0d6597fa98e89615e6d82eed9488fd9a1e087 (diff)
downloadfatcat-a14d851ad230b3adb569ec6ca112cd4d9e638b2c.tar.gz
fatcat-a14d851ad230b3adb569ec6ca112cd4d9e638b2c.zip
mechanism to not double-update entities
Diffstat (limited to 'python/fatcat_tools/importers/common.py')
-rw-r--r--python/fatcat_tools/importers/common.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/python/fatcat_tools/importers/common.py b/python/fatcat_tools/importers/common.py
index dd30e198..49931542 100644
--- a/python/fatcat_tools/importers/common.py
+++ b/python/fatcat_tools/importers/common.py
@@ -171,6 +171,7 @@ class EntityImporter:
self._edit_count = 0
self._editgroup_id = None
self._entity_queue = []
+ self._edits_inflight = []
def push_record(self, raw_record):
"""
@@ -199,6 +200,7 @@ class EntityImporter:
self.api.accept_editgroup(self._editgroup_id)
self._editgroup_id = None
self._edit_count = 0
+ self._edits_inflight = []
if self._entity_queue:
self.insert_batch(self._entity_queue)
@@ -215,6 +217,7 @@ class EntityImporter:
self.api.accept_editgroup(self._editgroup_id)
self._editgroup_id = None
self._edit_count = 0
+ self._edits_inflight = []
if not self._editgroup_id:
eg = self.api.create_editgroup(