diff options
Diffstat (limited to 'internal/config/config.go')
| -rw-r--r-- | internal/config/config.go | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 87ca4eb..91e79f7 100644 --- a/internal/config/config.go +++ b/internal/config/config.go | |||
| @@ -31,9 +31,9 @@ type ServerConfig struct { | |||
| 31 | 31 | ||
| 32 | // DatabaseConfig holds database configuration. | 32 | // DatabaseConfig holds database configuration. |
| 33 | type DatabaseConfig struct { | 33 | type DatabaseConfig struct { |
| 34 | Path string `yaml:"path"` | 34 | Path string `yaml:"path"` |
| 35 | MaxConnections int `yaml:"max_connections"` | 35 | // Note: SQLite connection pooling is handled internally in the storage layer. |
| 36 | MaxLifetime time.Duration `yaml:"max_lifetime"` | 36 | // SQLite works best with a single connection due to its single-writer architecture. |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | // AuthConfig holds authentication configuration. | 39 | // AuthConfig holds authentication configuration. |
| @@ -106,9 +106,7 @@ func Default() *Config { | |||
| 106 | WriteTimeout: 30 * time.Second, | 106 | WriteTimeout: 30 * time.Second, |
| 107 | }, | 107 | }, |
| 108 | Database: DatabaseConfig{ | 108 | Database: DatabaseConfig{ |
| 109 | Path: "relay.db", | 109 | Path: "relay.db", |
| 110 | MaxConnections: 10, | ||
| 111 | MaxLifetime: 1 * time.Hour, | ||
| 112 | }, | 110 | }, |
| 113 | Auth: AuthConfig{ | 111 | Auth: AuthConfig{ |
| 114 | Enabled: false, | 112 | Enabled: false, |
| @@ -239,12 +237,6 @@ func applyEnvOverrides(cfg *Config) { | |||
| 239 | if val := os.Getenv("MUXSTR_DATABASE_PATH"); val != "" { | 237 | if val := os.Getenv("MUXSTR_DATABASE_PATH"); val != "" { |
| 240 | cfg.Database.Path = val | 238 | cfg.Database.Path = val |
| 241 | } | 239 | } |
| 242 | if val := os.Getenv("MUXSTR_DATABASE_MAX_CONNECTIONS"); val != "" { | ||
| 243 | var n int | ||
| 244 | if _, err := fmt.Sscanf(val, "%d", &n); err == nil { | ||
| 245 | cfg.Database.MaxConnections = n | ||
| 246 | } | ||
| 247 | } | ||
| 248 | 240 | ||
| 249 | // Auth | 241 | // Auth |
| 250 | if val := os.Getenv("MUXSTR_AUTH_ENABLED"); val != "" { | 242 | if val := os.Getenv("MUXSTR_AUTH_ENABLED"); val != "" { |
