How to Configure OpenDeepWiki Incremental Repository Update Interval
Set the PollingIntervalSeconds and DefaultUpdateIntervalMinutes values in the IncrementalUpdate section of appsettings.json to control how frequently the background worker checks for repository changes.
OpenDeepWiki uses a background worker to keep wiki content synchronized with source repositories. Configuring the incremental repository update interval allows you to balance content freshness against system resources and API rate limits.
Understanding the Incremental Update Architecture
OpenDeepWiki implements incremental updates through the IncrementalUpdateWorker class located in src/OpenDeepWiki/Services/Repositories/IncrementalUpdateWorker.cs. This background service continuously polls for pending tasks and schedules repository checks based on configurable time intervals.
The worker relies on the IncrementalUpdateOptions class defined in src/OpenDeepWiki/Services/Repositories/IncrementalUpdateOptions.cs to determine timing behavior. These options bind automatically to the IncrementalUpdate configuration section during startup in src/OpenDeepWiki/Program.cs using the standard .NET Options pattern.
Key Configuration Options
PollingIntervalSeconds
The PollingIntervalSeconds setting controls how long the worker waits between each polling cycle. In IncrementalUpdateWorker.cs, the worker calls Task.Delay(TimeSpan.FromSeconds(_options.PollingIntervalSeconds)) to pause execution between iterations.
- Default value:
60seconds - Impact: Lower values increase CPU usage but reduce latency for detecting manual triggers. Higher values conserve resources but may delay processing.
DefaultUpdateIntervalMinutes
The DefaultUpdateIntervalMinutes setting determines the minimum time between scheduled update checks for repositories that have already completed a previous check. The CheckScheduledUpdatesAsync method compares LastUpdateCheckAt against UpdateIntervalMinutes ?? _options.DefaultUpdateIntervalMinutes to decide whether to create a new incremental update task.
- Default value:
60minutes - Impact: Controls the baseline freshness of wiki content. Reduce this value to sync more frequently with active repositories, or increase it to reduce API calls for stable codebases.
MinUpdateIntervalMinutes and Other Options
The MinUpdateIntervalMinutes setting establishes a lower bound for repository-specific intervals configured by users. While not directly referenced in the worker logic, it enforces validation when persisting user-defined settings.
Additional options in the same configuration section include:
MaxRetryAttempts(default:3): Controls workspace preparation retries inIncrementalUpdateServiceRetryBaseDelayMs(default:1000): Base delay between retry attemptsManualTriggerPriority(default:100): Priority value for manually triggered updates
How to Configure the Update Interval
Method 1: Edit appsettings.json
Modify the IncrementalUpdate section in your appsettings.json file:
{
"IncrementalUpdate": {
"PollingIntervalSeconds": 30,
"DefaultUpdateIntervalMinutes": 15,
"MinUpdateIntervalMinutes": 5,
"MaxRetryAttempts": 5,
"RetryBaseDelayMs": 2000,
"ManualTriggerPriority": 200
}
}
This configuration sets the worker to poll every 30 seconds and schedule repository updates every 15 minutes.
Method 2: Environment Variables
For containerized deployments or CI pipelines, use environment variables with double underscores to represent nested configuration:
IncrementalUpdate__PollingIntervalSeconds=30
IncrementalUpdate__DefaultUpdateIntervalMinutes=15
IncrementalUpdate__MinUpdateIntervalMinutes=5
In Docker Compose:
services:
opendeepwiki:
image: aidotnet/opendeepwiki
environment:
- IncrementalUpdate__PollingIntervalSeconds=20
- IncrementalUpdate__DefaultUpdateIntervalMinutes=10
After changing configuration, restart the application to reload the BackgroundService with new timing values.
Code Examples
Accessing Configuration Programmatically
If you need to read the current interval settings in your own services:
public class RepositorySyncMonitor
{
private readonly IncrementalUpdateOptions _options;
public RepositorySyncMonitor(IOptions<IncrementalUpdateOptions> options)
{
_options = options.Value;
}
public void LogCurrentSettings()
{
Console.WriteLine($"Polling interval: {_options.PollingIntervalSeconds}s");
Console.WriteLine($"Default update interval: {_options.DefaultUpdateIntervalMinutes}m");
Console.WriteLine($"Minimum allowed interval: {_options.MinUpdateIntervalMinutes}m");
}
}
Repository-Specific Override
Individual repositories can specify their own update intervals (subject to the global minimum):
// When configuring a specific repository
repository.UpdateIntervalMinutes = 20; // Must be >= MinUpdateIntervalMinutes (default 5)
Summary
- OpenDeepWiki uses
IncrementalUpdateWorkerinsrc/OpenDeepWiki/Services/Repositories/IncrementalUpdateWorker.csto process background updates. - Configure intervals through the
IncrementalUpdatesection inappsettings.jsonor environment variables. PollingIntervalSecondscontrols how often the worker wakes up (default: 60 seconds).DefaultUpdateIntervalMinutessets the baseline time between repository syncs (default: 60 minutes).MinUpdateIntervalMinutesenforces a lower bound of 5 minutes for user-defined repository intervals.- Restart the application after changing configuration to apply new timing values.
Frequently Asked Questions
What is the minimum update interval I can set for a repository?
The minimum update interval is controlled by the MinUpdateIntervalMinutes setting, which defaults to 5 minutes. While you can lower the global DefaultUpdateIntervalMinutes, individual repository intervals cannot be set below this minimum threshold to prevent excessive API usage.
How do I temporarily disable automatic incremental updates?
To disable automatic updates, you can set the DefaultUpdateIntervalMinutes to a very high value (e.g., 525600 for one year) or set PollingIntervalSeconds to 0 (though this may cause high CPU usage). Alternatively, comment out the IncrementalUpdateWorker registration in Program.cs if you need to completely stop the background service.
Why are my configuration changes not taking effect?
OpenDeepWiki reads the IncrementalUpdateOptions at startup when the BackgroundService initializes. If you modify appsettings.json or environment variables while the application is running, you must restart the service for the new PollingIntervalSeconds and DefaultUpdateIntervalMinutes values to load into the IncrementalUpdateWorker.
Can different repositories have different update intervals?
Yes. While the DefaultUpdateIntervalMinutes provides a system-wide baseline, individual repositories can specify their own UpdateIntervalMinutes property. The CheckScheduledUpdatesAsync method in IncrementalUpdateWorker.cs checks for a repository-specific value first, falling back to the global default only if none is set.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →