Reduce insert pressure in db. Increase sqlite timeout value

Entire-Checkpoint: a1e2931d4deb
This commit is contained in:
2026-03-16 11:17:47 +01:00
parent 0aad8f01c8
commit 51517f8031
9 changed files with 142 additions and 13 deletions

View File

@@ -46,6 +46,12 @@ type RepositoryConfig struct {
// It's a soft limit — queries won't fail, but cache eviction becomes more aggressive.
// Default: 16384 (16GB)
DbSoftHeapLimitMB int
// BusyTimeoutMs is the SQLite busy_timeout in milliseconds.
// When a write is blocked by another writer, SQLite retries internally
// using a backoff mechanism for up to this duration before returning SQLITE_BUSY.
// Default: 60000 (60 seconds)
BusyTimeoutMs int
}
// DefaultConfig returns the default repository configuration.
@@ -60,6 +66,7 @@ func DefaultConfig() *RepositoryConfig {
MinRunningJobDuration: 600, // 10 minutes
DbCacheSizeMB: 2048, // 2GB per connection
DbSoftHeapLimitMB: 16384, // 16GB process-wide
BusyTimeoutMs: 60000, // 60 seconds
}
}