# How to Configure OpenDeepWiki Incremental Repository Update Interval

> Configure OpenDeepWiki incremental repository update interval by adjusting PollingIntervalSeconds and DefaultUpdateIntervalMinutes in appsettings.json. Keep your wiki in sync efficiently.

- Repository: [AIDotNet/OpenDeepWiki](https://github.com/aidotnet/opendeepwiki)
- Tags: how-to-guide
- Published: 2026-02-16

---

**Set the `PollingIntervalSeconds` and `DefaultUpdateIntervalMinutes` values in the `IncrementalUpdate` section of [`appsettings.json`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/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`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/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`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/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`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/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`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/IncrementalUpdateWorker.cs), the worker calls `Task.Delay(TimeSpan.FromSeconds(_options.PollingIntervalSeconds))` to pause execution between iterations.

- **Default value**: `60` seconds
- **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**: `60` minutes
- **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 in `IncrementalUpdateService`
- `RetryBaseDelayMs` (default: `1000`): Base delay between retry attempts
- `ManualTriggerPriority` (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`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/appsettings.json) file:

```json
{
  "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:

```bash
IncrementalUpdate__PollingIntervalSeconds=30
IncrementalUpdate__DefaultUpdateIntervalMinutes=15
IncrementalUpdate__MinUpdateIntervalMinutes=5

```

In Docker Compose:

```yaml
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:

```csharp
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):

```csharp
// When configuring a specific repository
repository.UpdateIntervalMinutes = 20; // Must be >= MinUpdateIntervalMinutes (default 5)

```

## Summary

- OpenDeepWiki uses `IncrementalUpdateWorker` in [`src/OpenDeepWiki/Services/Repositories/IncrementalUpdateWorker.cs`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/src/OpenDeepWiki/Services/Repositories/IncrementalUpdateWorker.cs) to process background updates.
- Configure intervals through the `IncrementalUpdate` section in [`appsettings.json`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/appsettings.json) or environment variables.
- **`PollingIntervalSeconds`** controls how often the worker wakes up (default: 60 seconds).
- **`DefaultUpdateIntervalMinutes`** sets the baseline time between repository syncs (default: 60 minutes).
- **`MinUpdateIntervalMinutes`** enforces 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`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/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`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/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`](https://github.com/AIDotNet/OpenDeepWiki/blob/main/IncrementalUpdateWorker.cs) checks for a repository-specific value first, falling back to the global default only if none is set.