Notify status bot token

This commit is contained in:
Luciano Gervasoni
2025-10-16 10:38:32 +02:00
parent dc784dabec
commit cbc422df36

View File

@@ -83,7 +83,7 @@ def notify_telegram_warning(last_hours, channel="WARNING"):
urls_data_status_dict["total"] = urls_data_status_dict.get("total", 0) + o.get("count") urls_data_status_dict["total"] = urls_data_status_dict.get("total", 0) + o.get("count")
MINIMUM_URLS_THRESHOLD = 10 MINIMUM_URLS_THRESHOLD = 10
MINIMUM_PROCESSED_URLS_RATIO = 0.5 MINIMUM_PROCESSED_URLS_RATIO = 0.7
# Minimum amount of URLs # Minimum amount of URLs
if (urls_data_status_dict.get("total") < MINIMUM_URLS_THRESHOLD): if (urls_data_status_dict.get("total") < MINIMUM_URLS_THRESHOLD):
@@ -108,7 +108,7 @@ def notify_telegram_warning(last_hours, channel="WARNING"):
.annotate(count=Count('id_url')) \ .annotate(count=Count('id_url')) \
.order_by('id_source__source') .order_by('id_source__source')
MINIMUM_SOURCES = 2 MINIMUM_SOURCES = 3
if (len(urls_data_source) < MINIMUM_SOURCES): if (len(urls_data_source) < MINIMUM_SOURCES):
message += "WARNING - Very few sources found URLs during the last {} hours".format(last_hours) message += "WARNING - Very few sources found URLs during the last {} hours".format(last_hours)
message += "\nURLs per source:\n" message += "\nURLs per source:\n"