mirror of
https://github.com/GrassrootsEconomics/cic-dw.git
synced 2024-12-22 19:07:33 +01:00
fix: (redis) bootstrap connection struct properly
This commit is contained in:
parent
da66f70bf9
commit
a68ae5a9eb
@ -47,13 +47,17 @@ func loadConfig(configFilePath string, k *koanf.Koanf) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func connectDb(dsn string) error {
|
||||
func connectDbs(dsn string) error {
|
||||
var err error
|
||||
db, err = pgxpool.Connect(context.Background(), dsn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
rClient = asynq.RedisClientOpt{
|
||||
Addr: conf.Db.Redis,
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ func init() {
|
||||
log.Fatal().Err(err).Msg("failed to load sql file")
|
||||
}
|
||||
|
||||
if err := connectDb(conf.Db.Postgres); err != nil {
|
||||
if err := connectDbs(conf.Db.Postgres); err != nil {
|
||||
log.Fatal().Err(err).Msg("failed to connect to postgres")
|
||||
}
|
||||
|
||||
|
@ -8,5 +8,5 @@ rpc = "http://127.0.0.1:8545"
|
||||
|
||||
[syncers]
|
||||
cache = "@every 20s"
|
||||
ussd = "@every 1m"
|
||||
token = "@every 10s"
|
||||
ussd = "@every 30"
|
||||
token = "@every 1m"
|
Loading…
Reference in New Issue
Block a user