continue refactor/purge

This commit is contained in:
Ian Norden
2020-09-01 16:15:31 -05:00
parent f4b7b92dd8
commit 0d28234804
24 changed files with 69 additions and 1075 deletions
+1 -9
View File
@@ -46,7 +46,6 @@ type Config struct {
WSEndpoint string
HTTPEndpoint string
IPCEndpoint string
NodeInfo node.Info
}
// NewConfig is used to initialize a watcher config from a .toml file
@@ -80,19 +79,12 @@ func NewConfig() (*Config, error) {
}
c.HTTPEndpoint = httpPath
overrideDBConnConfig(&c.DBConfig)
serveDB := utils.LoadPostgres(c.DBConfig, c.NodeInfo)
serveDB := utils.LoadPostgres(c.DBConfig, postgres.Info{})
c.DB = &serveDB
return c, nil
}
type mode string
var (
Sync mode = "sync"
Serve mode = "serve"
)
func overrideDBConnConfig(con *postgres.Config) {
viper.BindEnv("database.server.maxIdle", SERVER_MAX_IDLE_CONNECTIONS)
viper.BindEnv("database.server.maxOpen", SERVER_MAX_OPEN_CONNECTIONS)