mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-23 04:06:39 +00:00
revert another unrelated change
This commit is contained in:
parent
a4f6f1474e
commit
77736957ec
|
@ -408,12 +408,13 @@ func maxOpenConns() int {
|
||||||
// deriveBunDBPGOptions takes an application config and returns either a ready-to-use set of options
|
// deriveBunDBPGOptions takes an application config and returns either a ready-to-use set of options
|
||||||
// with sensible defaults, or an error if it's not satisfied by the provided config.
|
// with sensible defaults, or an error if it's not satisfied by the provided config.
|
||||||
func deriveBunDBPGOptions() (*pgx.ConnConfig, error) {
|
func deriveBunDBPGOptions() (*pgx.ConnConfig, error) {
|
||||||
// If database URL is defined, ignore
|
url := config.GetDbPostgresConnectionString()
|
||||||
// other DB-related configuration fields.
|
|
||||||
if url := config.GetDbPostgresConnectionString(); url != "" {
|
|
||||||
return pgx.ParseConfig(url)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// if database URL is defined, ignore other DB related configuration fields
|
||||||
|
if url != "" {
|
||||||
|
cfg, err := pgx.ParseConfig(url)
|
||||||
|
return cfg, err
|
||||||
|
}
|
||||||
// these are all optional, the db adapter figures out defaults
|
// these are all optional, the db adapter figures out defaults
|
||||||
address := config.GetDbAddress()
|
address := config.GetDbAddress()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue