aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2017-11-21 20:20:20 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2017-11-21 20:20:20 -0800
commit9ff3c4504cc06291aad5a055ba5db35c6d1fb9e0 (patch)
treee59f7de5ed2cdaa9eda9ae0911796ff3a159f536 /main.go
parent6690f6a70eb319c1156f8a1bb7465e048567580a (diff)
Set all default config values in config package
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/main.go b/main.go
index aedbd0a..9ab7cdc 100644
--- a/main.go
+++ b/main.go
@@ -47,8 +47,17 @@ func run(cfg *config.Config, store *storage.Storage) {
server := server.NewServer(cfg, store, feedHandler)
go func() {
- pool := scheduler.NewWorkerPool(feedHandler, cfg.GetInt("WORKER_POOL_SIZE", 5))
- scheduler.NewScheduler(store, pool, cfg.GetInt("POLLING_FREQUENCY", 30), cfg.GetInt("BATCH_SIZE", 10))
+ pool := scheduler.NewWorkerPool(
+ feedHandler,
+ cfg.GetInt("WORKER_POOL_SIZE", config.DefaultWorkerPoolSize),
+ )
+
+ scheduler.NewScheduler(
+ store,
+ pool,
+ cfg.GetInt("POLLING_FREQUENCY", config.DefaultPollingFrequency),
+ cfg.GetInt("BATCH_SIZE", config.DefaultBatchSize),
+ )
}()
<-stop
@@ -82,8 +91,8 @@ func main() {
cfg := config.NewConfig()
store := storage.NewStorage(
- cfg.Get("DATABASE_URL", "postgres://postgres:postgres@localhost/miniflux2?sslmode=disable"),
- cfg.GetInt("DATABASE_MAX_CONNS", 20),
+ cfg.Get("DATABASE_URL", config.DefaultDatabaseURL),
+ cfg.GetInt("DATABASE_MAX_CONNS", config.DefaultDatabaseMaxConns),
)
if *flagInfo {