Skip to content

Scheduler Configuration

The scheduler section configures automatic repository synchronization to keep indexes up-to-date.

scheduler:
enabled: true
poll_interval: 6h
check_interval: 5m
stale_threshold: 24h
max_concurrent_checks: 5
job_retention: 1h

Enable or disable the automatic scheduler.

PropertyValue
Typeboolean
Defaulttrue
EnvironmentCS_SCHEDULER_ENABLED

When enabled, the scheduler automatically queues repositories for re-indexing based on poll_interval.

Default time between syncs for each repository.

PropertyValue
Typeduration
Default6h
EnvironmentCS_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)

How often the scheduler checks for repositories needing sync.

PropertyValue
Typeduration
Default5m
EnvironmentCS_SCHEDULER_CHECK_INTERVAL

This is how frequently the scheduler looks for repos that need syncing.

Maximum time before a repository is considered stale and needs sync.

PropertyValue
Typeduration
Default24h
EnvironmentCS_SCHEDULER_STALE_THRESHOLD

Maximum number of parallel git fetch checks.

PropertyValue
Typeinteger
Default5
EnvironmentCS_SCHEDULER_MAX_CONCURRENT_CHECKS

Controls how many repositories can be checked for updates simultaneously.

How long to keep completed/failed jobs before automatic cleanup.

PropertyValue
Typeduration
Default1h
EnvironmentCS_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 minutes
  • 1h - Keep jobs for 1 hour (default)
  • 24h - Keep jobs for 24 hours
  • 0 - Disable automatic cleanup
Terminal window
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"
  1. Check - Every check_interval, find repos not indexed recently
  2. Queue - Add sync jobs to Redis queue
  3. Process - Indexer picks up and processes jobs
  4. Update - last_indexed timestamp is updated

Individual repositories can have custom poll intervals:

Terminal window
# Set via API
curl -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 default
curl -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

Trigger a sync manually:

Terminal window
# Sync a single repository
curl -X POST "http://localhost:8080/api/v1/repos/by-id/123/sync"
# Sync a connection
curl -X POST "http://localhost:8080/api/v1/connections/1/sync"

To disable automatic scheduling:

scheduler:
enabled: false

With the scheduler disabled:

  • Repositories are only indexed on initial add
  • Use manual sync to update indexes
  • Useful for read-only/archive deployments
Repository TypeRecommended Poll Interval
Active development1h - 6h
Stable/maintenance24h
ArchivesUse per-repo custom interval
  • Lower poll_interval = more indexing jobs = more resources
  • Consider your indexer capacity when setting intervals
  • Monitor job queue length to ensure indexers keep up
  1. Check scheduler is enabled: scheduler.enabled: true
  2. Verify intervals are set correctly
  3. Check jobs page for pending/failed jobs
  4. Verify indexer is running and processing jobs

If the job queue grows faster than indexers can process:

  • Increase indexer concurrency
  • Increase poll_interval to reduce frequency
  • Set per-repo poll intervals for less active repos