this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: add WAL mode and busy timeout for SQLite concurrency

Enables concurrent write operations in SQLite by adding journal_mode(WAL)
and busy_timeout(5000) pragmas to the connection string. This prevents
"readonly database" errors during concurrent API operations.

+4 -1
+4 -1
internal/config/config.go
··· 81 81 func (c *Config) DSN() string { 82 82 if c.Driver == "sqlite" || c.Driver == "sqlite3" { 83 83 // For SQLite, "Database" field is the file path 84 - return c.Database 84 + // Add connection parameters for proper write access: 85 + // - journal_mode(WAL) enables Write-Ahead Logging for better concurrency 86 + // - busy_timeout(5000) waits up to 5 seconds if database is locked 87 + return c.Database + "?_pragma=journal_mode(WAL)&_pragma=busy_timeout(5000)" 85 88 } 86 89 // MySQL: username:password@tcp(host)/dbname?parseTime=true 87 90 dsn := fmt.Sprintf("%s:%s@tcp(%s)/%s?parseTime=true", c.Username, c.Password, c.Host, c.Database)