aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-04-12 10:51:31 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-04-12 10:51:31 -0700
commit389f391f42442c5df1f91d7cc3243e7c7d561909 (patch)
tree6e93458ce4e3193e194a1c7912464f85914c699a /python
parent91b76672a759de4cd368260e709b94d70b2f2e40 (diff)
downloadfatcat-389f391f42442c5df1f91d7cc3243e7c7d561909.tar.gz
fatcat-389f391f42442c5df1f91d7cc3243e7c7d561909.zip
es indexing: more 'wip' fixes
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/workers/elasticsearch.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/python/fatcat_tools/workers/elasticsearch.py b/python/fatcat_tools/workers/elasticsearch.py
index 3e4753fb..d9edb276 100644
--- a/python/fatcat_tools/workers/elasticsearch.py
+++ b/python/fatcat_tools/workers/elasticsearch.py
@@ -118,7 +118,7 @@ class ElasticsearchReleaseWorker(FatcatWorker):
else:
key = entity.ident
- if entity.state == 'wip':
+ if self.entity_type != ChangelogEntry and entity.state == 'wip':
print(f"WARNING: skipping state=wip entity: {self.entity_type.__name__} {entity.ident}", file=sys.stderr)
continue
@@ -139,6 +139,10 @@ class ElasticsearchReleaseWorker(FatcatWorker):
}))
bulk_actions.append(json.dumps(doc_dict))
+ # if only WIP entities, then skip
+ if not bulk_actions:
+ continue
+
print("Upserting, eg, {} (of {} {} in elasticsearch)".format(key, len(batch), self.entity_type.__name__), file=sys.stderr)
elasticsearch_endpoint = "{}/{}/_bulk".format(
self.elasticsearch_backend,