fix(scheduler): scheduled scans are spread out and at most two clones run per git host #547

Merged
sharang merged 2 commits from fix/scheduled-scan-spread into main 2026-10-09 14:37:23 +00:00
2 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 a5720f9fa3 refactor(git): the retry wait and the clone limit share one off-the-runtime wrapper
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 11m19s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
2026-10-09 16:25:11 +02:00
Sharang ParnerkarandClaude Opus 5.5 9579bf44d5 fix(scheduler): scheduled scans are spread out and at most two clones run per git host
A scheduled scan now starts after a random delay of up to 30 s
(SCHEDULED_SCAN_JITTER), applied in run_target_scan before the target and
a scan slot are taken; webhook, manual and support scans start at once.
Every clone or fetch takes one of two slots of its git host
(pipeline/clone_limit.rs, process-wide), held only around clone_or_fetch,
so a tenant's scans no longer all hit one self-hosted Gitea together,
while another host's clones go ahead. The global scan semaphore stays.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
2026-10-09 16:22:37 +02:00