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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func connectDb(dsn string) error {
|
func connectDbs(dsn string) error {
|
||||||
var err error
|
var err error
|
||||||
db, err = pgxpool.Connect(context.Background(), dsn)
|
db, err = pgxpool.Connect(context.Background(), dsn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rClient = asynq.RedisClientOpt{
|
||||||
|
Addr: conf.Db.Redis,
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ func init() {
|
|||||||
log.Fatal().Err(err).Msg("failed to load sql file")
|
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")
|
log.Fatal().Err(err).Msg("failed to connect to postgres")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,5 +8,5 @@ rpc = "http://127.0.0.1:8545"
|
|||||||
|
|
||||||
[syncers]
|
[syncers]
|
||||||
cache = "@every 20s"
|
cache = "@every 20s"
|
||||||
ussd = "@every 1m"
|
ussd = "@every 30"
|
||||||
token = "@every 10s"
|
token = "@every 1m"
|
Loading…
Reference in New Issue
Block a user