From 0759c0ef80c5e9a1d6692af70dddfc69f19138d8 Mon Sep 17 00:00:00 2001
From: Alessandro Cerioni <acerioni@grandlyon.com>
Date: Mon, 8 Apr 2019 13:56:00 +0200
Subject: [PATCH] Handling the case in which a table is empty.

---
 3-doc-enricher.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/3-doc-enricher.py b/3-doc-enricher.py
index 8e79a9d..9d84692 100644
--- a/3-doc-enricher.py
+++ b/3-doc-enricher.py
@@ -210,6 +210,10 @@ def enrich_docs( channel, method, properties, body, **kwargs ):
     #if feature_page != None:
     #print('here')
     for feature_page in get_entries_from_postgis(wfs_info, kwargs['postgis_cfg']):
+
+        if len(feature_page) == 0:
+            logging.debug('Empty page!')
+            continue
         #print('here')
         logging.info('Sending feature page of len = %i to RabbitMQ...' % len(feature_page))
         # for el in feature_page:
-- 
GitLab