From 389f391f42442c5df1f91d7cc3243e7c7d561909 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 12 Apr 2021 10:51:31 -0700 Subject: es indexing: more 'wip' fixes --- python/fatcat_tools/workers/elasticsearch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'python') 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, -- cgit v1.2.3