fix: always reset validator offset on start (fixes wrong TLD resuming previous offset)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -272,16 +272,16 @@ def start_validator(tld_filter: Optional[str] = None):
|
||||
global _val_task, _val_stats
|
||||
if _val_task and not _val_task.done():
|
||||
return # already running
|
||||
_val_stats["running"] = True
|
||||
_val_stats["tld_filter"] = tld_filter
|
||||
# Only reset counters on a completely fresh start
|
||||
if not _val_stats.get("processed"):
|
||||
# Always reset for a fresh run — _filter_unvalidated skips already-done
|
||||
# domains, so restarting from 0 is safe and fast even for the same TLD.
|
||||
_val_stats.update(
|
||||
running=True,
|
||||
processed=0, live=0, dead=0, parked=0,
|
||||
redirect=0, skipped=0, offset=0, rate=0.0,
|
||||
tld_filter=tld_filter,
|
||||
)
|
||||
_val_task = asyncio.create_task(_validator_loop(tld_filter))
|
||||
logger.info("Validator started (tld=%s, offset=%d)", tld_filter, _val_stats["offset"])
|
||||
logger.info("Validator started (tld=%s)", tld_filter)
|
||||
|
||||
|
||||
def stop_validator():
|
||||
|
||||
Reference in New Issue
Block a user