feat: add retry(10) on all network requests

- New src/retry.py with configurable retry decorator
- Applied @retry() to fetch_unseen_emails, mark_as_seen,
  summarize_email, and send_message
- No backoff delay between retries
This commit is contained in:
2026-07-02 20:02:03 +08:00
parent 89149b506c
commit a6817d3e11
4 changed files with 36 additions and 0 deletions

View File

@@ -1,7 +1,9 @@
import requests
from src.config import TelegramConfig
from src.retry import retry
@retry()
def send_message(tg_cfg: TelegramConfig, text: str):
url = f"https://api.telegram.org/bot{tg_cfg.bot_token}/sendMessage"
payload = {