Schools NL tuples, traceback on notify err

This commit is contained in:
Luciano Gervasoni
2025-10-14 11:33:17 +02:00
parent f44b784715
commit 7924857fe5
2 changed files with 104 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ from ..models import Urls, Source, Search, UrlContent, UrlsSourceSearch, UrlsDup
from django.db.models import Count
import requests
import os
import traceback
from .logger import get_logger
logger = get_logger()
@@ -57,7 +58,7 @@ def notify_telegram_info(last_hours, channel="INFO"):
# POST
response = requests.post(url, params=params)
except Exception as e:
logger.info("Exception while notifying status: {}".format(str(e)))
logger.info("Exception while notifying status: {}\n{}".format(str(e), traceback.format_exc()))
def notify_telegram_warning(last_hours, channel="WARNING"):
@@ -142,7 +143,7 @@ def notify_telegram_warning(last_hours, channel="WARNING"):
# POST
response = requests.post(url, params=params)
except Exception as e:
logger.info("Exception while notifying status: {}".format(str(e)))
logger.info("Exception while notifying status: {}\n{}".format(str(e)), traceback.format_exc())
def notify_telegram(last_hours=12):