fix(debug): sweep expired pending pastes on slash debug paths

This commit is contained in:
Junass1 2026-04-22 21:18:17 +03:00 committed by kshitij
parent 921133cfa5
commit 61d0a99c11
4 changed files with 110 additions and 1 deletions

View file

@ -148,6 +148,14 @@ def _sweep_expired_pastes(now: Optional[float] = None) -> tuple[int, int]:
return (deleted, len(remaining))
def _best_effort_sweep_expired_pastes() -> None:
"""Attempt pending-paste cleanup without letting /debug fail offline."""
try:
_sweep_expired_pastes()
except Exception:
pass
# ---------------------------------------------------------------------------
# Privacy / delete helpers
# ---------------------------------------------------------------------------
@ -518,6 +526,8 @@ def collect_debug_report(
def run_debug_share(args):
"""Collect debug report + full logs, upload each, print URLs."""
_best_effort_sweep_expired_pastes()
log_lines = getattr(args, "lines", 200)
expiry = getattr(args, "expire", 7)
local_only = getattr(args, "local", False)