🔍 Overview

These tasks monitor Offer Links:

  • block offer links when domains become unsafe (Google Safe Browsing)
  • block offer links when domains are not resolvable (DNS)
  • unblock offer links when they become safe again

Notifications are sent via the offers Telegram bot.


⏱ Schedule (Celery Beat)

Configured in config/settings.py:

  • check_active_offer_links_task — every hour (minute 0)
  • check_blocked_offer_links_task — daily at 08:30

📝 Task Behavior

  • selects offer links with statuses: active and unblocked
  • checks their domains via Google Safe Browsing
  • for unsafe domains: calls OfferLink.set_block(reason=threat_type)
  • triggers DNS check task after completion
  • for each domain that is not resolvable:
    • blocks all matching offer links with reason DNS_NOT_RESOLVABLE
  • selects offer links with status blocked (excluding DNS blocks)
  • checks domains via Google Safe Browsing
  • for safe domains: calls OfferLink.set_unblock()