File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -133,10 +133,19 @@ func run(ctx context.Context) error {
133133 zap .L ().Fatal ("Failed to connect to Redis" , zap .Error (err ))
134134 }
135135
136- connPQ , err := pgx .Connect (context .Background (), os .Getenv ("DATABASE_URL" ))
136+ pqDB := fmt .Sprintf ("postgres://%s:%s@%s:%d/%s?sslmode=%s" ,
137+ config .BackendConfig .Database .ArchivalPQ .User ,
138+ config .BackendConfig .Database .ArchivalPQ .Password ,
139+ config .BackendConfig .Database .ArchivalPQ .Host ,
140+ config .BackendConfig .Database .ArchivalPQ .Port ,
141+ config .BackendConfig .Database .ArchivalPQ .DBName ,
142+ config .BackendConfig .Database .ArchivalPQ .SSLMode ,
143+ )
144+
145+ connPQ , err := pgx .Connect (context .Background (), pqDB )
137146 if err != nil {
138- fmt .Fprintf (os .Stderr , "Unable to connect to database: %v\n " , err )
139- os .Exit (1 )
147+ fmt .Fprintf (os .Stderr , "Unable to connect to database: %v\n " , err )
148+ os .Exit (1 )
140149 }
141150
142151 archivalPQ := postgresql .New (connPQ )
You can’t perform that action at this time.
0 commit comments