mirror of
https://github.com/GrassrootsEconomics/cic-dw.git
synced 2026-05-20 04:41:09 +02:00
fix: (redis) bootstrap connection struct properly
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user