🔍 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 (minute0)check_blocked_offer_links_task— daily at08:30
📝 Task Behavior
1) Active offer links check (GSB)
- selects offer links with statuses:
activeandunblocked - checks their domains via Google Safe Browsing
- for unsafe domains: calls
OfferLink.set_block(reason=threat_type) - triggers DNS check task after completion
2) Active offer links check (DNS)
- for each domain that is not resolvable:
- blocks all matching offer links with reason
DNS_NOT_RESOLVABLE
- blocks all matching offer links with reason
3) Blocked offer links re-check (GSB)
- selects offer links with status
blocked(excluding DNS blocks) - checks domains via Google Safe Browsing
- for safe domains: calls
OfferLink.set_unblock()