diff --git a/manage.py b/manage.py index 2787a3a1..a6d92190 100755 --- a/manage.py +++ b/manage.py @@ -529,12 +529,13 @@ def es_monthly_check(token): lines = [] for idx, total in result.items(): if total < 20: - muni = ' '.join(idx.split('_')[1:-1]) + muni = ' '.join([i for i in idx.split('_')[1:-1] if i != 'fixed']) lines.append( "%s heeft %d documenten erbij in de afgelopen maand" % (muni, total,)) + #print(lines) if len(lines) > 0: payload = { - "title":"Found a bug", + "title":"Possible fetch problems this month ..." "body":"\n".join(lines), "assignees":[ "breyten"], diff --git a/ocd_backend/utils/monitor.py b/ocd_backend/utils/monitor.py index eff84b79..e526a4f5 100644 --- a/ocd_backend/utils/monitor.py +++ b/ocd_backend/utils/monitor.py @@ -27,13 +27,15 @@ def get_recent_counts(): "aggs": { "index": { "terms": { - "field": "_index" + "field": "_index", + "size": 10000 } } }, "size": 0 } resp = es.search(body=payload) + #print(resp) indices = get_indices() result = {i: 0 for i in indices} for b in resp.get('aggregations', {}).get('index', {}).get('buckets', []):