mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Create database package (refactoring)
This commit is contained in:
parent
17054b396e
commit
cf03e0e338
30 changed files with 61 additions and 54 deletions
|
@ -20,6 +20,7 @@ const (
|
|||
defaultPollingFrequency = 60
|
||||
defaultBatchSize = 10
|
||||
defaultDatabaseMaxConns = 20
|
||||
defaultDatabaseMinConns = 1
|
||||
defaultListenAddr = "127.0.0.1:8080"
|
||||
defaultCertFile = ""
|
||||
defaultKeyFile = ""
|
||||
|
@ -119,11 +120,16 @@ func (c *Config) DatabaseURL() string {
|
|||
return value
|
||||
}
|
||||
|
||||
// DatabaseMaxConnections returns the number of maximum database connections.
|
||||
func (c *Config) DatabaseMaxConnections() int {
|
||||
// DatabaseMaxConns returns the maximum number of database connections.
|
||||
func (c *Config) DatabaseMaxConns() int {
|
||||
return c.getInt("DATABASE_MAX_CONNS", defaultDatabaseMaxConns)
|
||||
}
|
||||
|
||||
// DatabaseMinConns returns the minimum number of database connections.
|
||||
func (c *Config) DatabaseMinConns() int {
|
||||
return c.getInt("DATABASE_MIN_CONNS", defaultDatabaseMinConns)
|
||||
}
|
||||
|
||||
// ListenAddr returns the listen address for the HTTP server.
|
||||
func (c *Config) ListenAddr() string {
|
||||
if port := os.Getenv("PORT"); port != "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue