fix: audit findings — edge cases in paginate, output, run
- paginate.py: max(nums) on empty set → guard - paginate.py: HEAD fallback to GET if server doesn't support HEAD - output.py: disk health check every 500 topics - run.py: avoid page-1 extra redirect - __main__.py: URL validation (must contain vwts.ru)
This commit is contained in:
@@ -39,3 +39,11 @@ def save_topic(section_slug: str, section_name: str, topic: dict,
|
||||
st["topic_count"] += 1
|
||||
log.info(f" 💾 part_{st['file_index']:04d}.jsonl "
|
||||
f"({fpath.stat().st_size/1024/1024:.1f} MB)")
|
||||
|
||||
if st["topic_count"] % 500 == 0:
|
||||
# Каждые 500 тем — проверяем что диск ещё жив
|
||||
try:
|
||||
fpath.stat()
|
||||
except OSError as e:
|
||||
log.critical(f"❌ Ошибка диска: {e}")
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user