Scheduler Configuration
The scheduler section configures automatic repository synchronization to keep indexes up-to-date.
Configuration
Section titled “Configuration”scheduler: enabled: true poll_interval: 6h check_interval: 5m stale_threshold: 24h max_concurrent_checks: 5 job_retention: 1hOptions
Section titled “Options”enabled
Section titled “enabled”Enable or disable the automatic scheduler.
| Property | Value |
|---|---|
| Type | boolean |
| Default | true |
| Environment | CS_SCHEDULER_ENABLED |
When enabled, the scheduler automatically queues repositories for re-indexing based on poll_interval.
poll_interval
Section titled “poll_interval”Default time between syncs for each repository.
| Property | Value |
|---|---|
| Type | duration |
| Default | 6h |
| Environment | CS_SCHEDULER_POLL_INTERVAL |
Repositories will be re-indexed at least this often.
Examples:
1h- Every hour (for fast-moving repositories)6h- Every 6 hours (default, good balance)24h- Daily (for slow-moving repositories)
check_interval
Section titled “check_interval”How often the scheduler checks for repositories needing sync.
| Property | Value |
|---|---|
| Type | duration |
| Default | 5m |
| Environment | CS_SCHEDULER_CHECK_INTERVAL |
This is how frequently the scheduler looks for repos that need syncing.
stale_threshold
Section titled “stale_threshold”Maximum time before a repository is considered stale and needs sync.
| Property | Value |
|---|---|
| Type | duration |
| Default | 24h |
| Environment | CS_SCHEDULER_STALE_THRESHOLD |
max_concurrent_checks
Section titled “max_concurrent_checks”Maximum number of parallel git fetch checks.
| Property | Value |
|---|---|
| Type | integer |
| Default | 5 |
| Environment | CS_SCHEDULER_MAX_CONCURRENT_CHECKS |
Controls how many repositories can be checked for updates simultaneously.
job_retention
Section titled “job_retention”How long to keep completed/failed jobs before automatic cleanup.
| Property | Value |
|---|---|
| Type | duration |
| Default | 1h |
| Environment | CS_SCHEDULER_JOB_RETENTION |
The scheduler automatically cleans up old completed and failed jobs every 10 minutes. Set to 0 to disable automatic cleanup.
Examples:
30m- Keep jobs for 30 minutes1h- Keep jobs for 1 hour (default)24h- Keep jobs for 24 hours0- Disable automatic cleanup
Environment Variables
Section titled “Environment Variables”CS_SCHEDULER_ENABLED="true"CS_SCHEDULER_POLL_INTERVAL="6h"CS_SCHEDULER_CHECK_INTERVAL="5m"CS_SCHEDULER_STALE_THRESHOLD="24h"CS_SCHEDULER_MAX_CONCURRENT_CHECKS="5"CS_SCHEDULER_JOB_RETENTION="1h"How the Scheduler Works
Section titled “How the Scheduler Works”- Check - Every
check_interval, find repos not indexed recently - Queue - Add sync jobs to Redis queue
- Process - Indexer picks up and processes jobs
- Update -
last_indexedtimestamp is updated
Per-Repository Poll Intervals
Section titled “Per-Repository Poll Intervals”Individual repositories can have custom poll intervals:
# Set via APIcurl -X PUT "http://localhost:8080/api/v1/repos/by-id/123/poll-interval" \ -H "Content-Type: application/json" \ -d '{"interval_seconds": 3600}' # 1 hour
# Reset to defaultcurl -X PUT "http://localhost:8080/api/v1/repos/by-id/123/poll-interval" \ -H "Content-Type: application/json" \ -d '{"interval_seconds": 0}'Use this for:
- High-activity repositories that need frequent updates
- Archives or slow-moving repos that don’t need frequent syncs
Manual Sync
Section titled “Manual Sync”Trigger a sync manually:
# Sync a single repositorycurl -X POST "http://localhost:8080/api/v1/repos/by-id/123/sync"
# Sync a connectioncurl -X POST "http://localhost:8080/api/v1/connections/1/sync"Disabling the Scheduler
Section titled “Disabling the Scheduler”To disable automatic scheduling:
scheduler: enabled: falseWith the scheduler disabled:
- Repositories are only indexed on initial add
- Use manual sync to update indexes
- Useful for read-only/archive deployments
Best Practices
Section titled “Best Practices”Poll Interval Selection
Section titled “Poll Interval Selection”| Repository Type | Recommended Poll Interval |
|---|---|
| Active development | 1h - 6h |
| Stable/maintenance | 24h |
| Archives | Use per-repo custom interval |
Resource Considerations
Section titled “Resource Considerations”- Lower
poll_interval= more indexing jobs = more resources - Consider your indexer capacity when setting intervals
- Monitor job queue length to ensure indexers keep up
Troubleshooting
Section titled “Troubleshooting”Repos not being synced
Section titled “Repos not being synced”- Check scheduler is enabled:
scheduler.enabled: true - Verify intervals are set correctly
- Check jobs page for pending/failed jobs
- Verify indexer is running and processing jobs
Too many jobs queued
Section titled “Too many jobs queued”If the job queue grows faster than indexers can process:
- Increase indexer concurrency
- Increase
poll_intervalto reduce frequency - Set per-repo poll intervals for less active repos