diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/fatcat_tools/workers/elasticsearch.py | 6 |
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, |