release: Themiz на Gitea

This commit is contained in:
public-repo-gate
2026-10-19 11:10:53 +03:00
parent e52e76d4ea
commit 067c6c2414
225 changed files with 240125 additions and 26157 deletions
+7 -6
View File
@@ -22,10 +22,7 @@ MAX_RUNTIME_SECONDS = 15 * 60
SOURCE_TIMEOUT_SECONDS = 120 # enforced by maintenance_fetch/Lynceuz
CORPUS_EXTRACTOR_VERSION = 2
CORPUS_RECEIPT_TTL = timedelta(days=7)
BLOCKED_FETCH_CODES = frozenset({
"access_denied", "auth_required", "captcha", "paid_required", "paywall",
"policy_denied", "robots_denied", "unapproved_sudact_path",
})
BLOCKED_FETCH_CODES = maintenance_fetch.BLOCKED_CODES
DOCS = {
"technical-doc:markitdown-readme":
"https://raw.githubusercontent.com/microsoft/markitdown/main/README.md",
@@ -159,7 +156,7 @@ def _updater_stage(state_dir: Path, now: datetime, receipts: list[dict], deadlin
pass
return receipt["body"]
except maintenance_fetch.MaintenanceFetchError as exc:
corpus_updater.FAILURES.append(f"fetch:{exc.code}")
corpus_updater.FAILURES.append(f"fetch:{maintenance_fetch.blocked_code(exc) or exc.code}")
return None
except Exception as exc:
corpus_updater.FAILURES.append(f"internal:{type(exc).__name__}")
@@ -348,7 +345,7 @@ def _corpus(path: Path, state_dir: Path, now: datetime, online: bool,
deferred = deferred_from_deadline()
if deferred:
return deferred
raise RuntimeError("source check failed")
raise RuntimeError(f"source check failed: {'; '.join(corpus_updater.FAILURES) or result}"[:400])
unchanged = "без изменений" in result and not partial
if unchanged and not force_rebuild:
checked, revision = _receipt_proof(receipts)
@@ -441,6 +438,10 @@ def _corpus(path: Path, state_dir: Path, now: datetime, online: bool,
"extractor_version": CORPUS_EXTRACTOR_VERSION,
"candidate_sha256": _sha(candidate_raw)}
except (OSError, UnicodeError, ValueError, RuntimeError) as exc:
if time.monotonic() >= deadline: # сверку оборвал бюджет задания, а не источник
return {**_item(item_id, "deferred", detail="deadline exhausted before full corpus validation",
revision=local_revision),
"progress": _corpus_progress(state_dir, path.stem, edition, datetime.now(UTC))}
return _item(item_id, "failed", detail=f"refresh not activated: {exc}",
revision=local_revision)