this repo has no description
0
fork

Configure Feed

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

tweak postgres settings

dholms 3e2e3dd5 d4fe3b9a

+3 -12
+3 -12
cmd/nexus/nexus.go
··· 4 4 "context" 5 5 "fmt" 6 6 "log/slog" 7 - "os" 8 - "path/filepath" 9 7 "strings" 10 8 "sync" 11 9 "time" ··· 197 195 // Setup database connection (supports both SQLite and Postgres) 198 196 var dialector gorm.Dialector 199 197 isSqlite := false 200 - maxOpenConns := 80 201 198 202 199 if strings.HasPrefix(dbUrl, "sqlite://") { 203 200 sqlitePath := dbUrl[len("sqlite://"):] 204 - // Create directory if it doesn't exist 205 - if err := os.MkdirAll(filepath.Dir(sqlitePath), os.ModePerm); err != nil { 206 - return nil, err 207 - } 208 - // SQLite with pragmas in connection string 209 - dialector = sqlite.Open(sqlitePath + "?_journal_mode=WAL&_busy_timeout=10000&_synchronous=NORMAL&_temp_store=MEMORY&_cache_size=8000&_wal_autocheckpoint=3000") 201 + dialector = sqlite.Open(sqlitePath) 210 202 isSqlite = true 211 - maxOpenConns = 1 212 203 } else if strings.HasPrefix(dbUrl, "postgresql://") || strings.HasPrefix(dbUrl, "postgres://") { 213 204 dialector = postgres.Open(dbUrl) 214 205 } else { ··· 235 226 if err != nil { 236 227 return nil, err 237 228 } 238 - sqlDB.SetMaxOpenConns(maxOpenConns) 239 - sqlDB.SetMaxIdleConns(maxOpenConns) 229 + sqlDB.SetMaxOpenConns(400) 230 + sqlDB.SetMaxIdleConns(400) 240 231 sqlDB.SetConnMaxIdleTime(time.Hour) 241 232 242 233 }