Fix tier-based monitoring: Scout users no longer get Tycoon-level checks
Previously, the realtime (10-min) check job would check ALL tiers including Scout users, giving them free premium service. Now: - daily: checks ALL tiers (baseline service) - hourly: checks Trader + Tycoon only - realtime: checks Tycoon only (premium feature)
This commit is contained in:
@ -65,14 +65,22 @@ async def check_domains_by_frequency(frequency: str):
|
|||||||
|
|
||||||
async with AsyncSessionLocal() as db:
|
async with AsyncSessionLocal() as db:
|
||||||
# Get users with matching check frequency
|
# Get users with matching check frequency
|
||||||
|
# IMPORTANT: Higher tiers get MORE frequent checks, not the other way around
|
||||||
|
# - daily: checks ALL tiers (minimum service level for everyone)
|
||||||
|
# - hourly: checks Trader + Tycoon only
|
||||||
|
# - realtime: checks Tycoon only
|
||||||
tiers_for_frequency = []
|
tiers_for_frequency = []
|
||||||
for tier, config in TIER_CONFIG.items():
|
for tier, config in TIER_CONFIG.items():
|
||||||
if config['check_frequency'] == frequency:
|
tier_freq = config['check_frequency']
|
||||||
|
|
||||||
|
if frequency == 'daily':
|
||||||
|
# Daily job checks ALL tiers (this is the baseline)
|
||||||
tiers_for_frequency.append(tier)
|
tiers_for_frequency.append(tier)
|
||||||
# Realtime includes hourly and daily too (more frequent = superset)
|
elif frequency == 'hourly' and tier_freq in ['hourly', 'realtime']:
|
||||||
elif frequency == 'realtime':
|
# Hourly job checks Trader + Tycoon
|
||||||
tiers_for_frequency.append(tier)
|
tiers_for_frequency.append(tier)
|
||||||
elif frequency == 'hourly' and config['check_frequency'] in ['hourly', 'realtime']:
|
elif frequency == 'realtime' and tier_freq == 'realtime':
|
||||||
|
# Realtime job checks ONLY Tycoon (premium feature)
|
||||||
tiers_for_frequency.append(tier)
|
tiers_for_frequency.append(tier)
|
||||||
|
|
||||||
# Get domains from users with matching subscription tier
|
# Get domains from users with matching subscription tier
|
||||||
|
|||||||
Reference in New Issue
Block a user