Skip to content

Conversation

@mbani01
Copy link
Contributor

@mbani01 mbani01 commented Nov 17, 2025

This pull request introduces a system safeguard to prevent overloading during periods of high activity by limiting repository onboarding based on the number of integration results. The main changes include adding a new configuration setting, implementing a load-checking function, and updating repository acquisition logic to respect system load.

System Load Management and Onboarding Control:

  • Added a new environment variable and setting, MAX_INTEGRATION_RESULTS, to configure the maximum allowed number of integration results before onboarding is paused. (services/apps/git_integration/src/crowdgit/settings.py)
  • Imported MAX_INTEGRATION_RESULTS in crud.py to make the setting available for onboarding logic. (services/apps/git_integration/src/crowdgit/database/crud.py)

Repository Processing Logic Improvements:

  • Introduced the can_onboard_more() async function to check if the current count of integration results is below the configured limit, returning False if the database is under high load or the query fails. (services/apps/git_integration/src/crowdgit/database/crud.py)
  • Updated acquire_repo_for_processing() to prioritize onboarding only when system load allows, falling back to recurrent repositories if onboarding is skipped due to high activity. Added documentation to clarify the new priority logic. (services/apps/git_integration/src/crowdgit/database/crud.py)

@mbani01 mbani01 requested a review from themarolt November 17, 2025 16:26
@mbani01 mbani01 self-assigned this Nov 17, 2025
@mbani01 mbani01 merged commit 469ac79 into main Nov 18, 2025
13 checks passed
@mbani01 mbani01 deleted the feat/delay_git_onboarding_during_high_load branch November 18, 2025 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants