diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2021-11-24 15:45:19 +0300 |
---|---|---|
committer | Pavlo Strokov <pstrokov@gitlab.com> | 2021-11-24 15:45:34 +0300 |
commit | 12bbe3257f3fd41450cb28b08c7c4ab18bfeafa0 (patch) | |
tree | 414c2f154674115c58ec0aa3360ecc7405c4578c /cmd | |
parent | cc65b3249181f3188f39942d5236987ecbd0a364 (diff) |
glsql: Replace DB.ToPQString with glqlsql.DSN
The change removes ToPQString method and replaces
its usages with glsql.DSN function.
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/praefect/main.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/praefect/main.go b/cmd/praefect/main.go index 1082914c0..8ba6acce8 100644 --- a/cmd/praefect/main.go +++ b/cmd/praefect/main.go @@ -250,12 +250,13 @@ func run( queue = datastore.NewPostgresReplicationEventQueue(db) rs = datastore.NewPostgresRepositoryStore(db, conf.StorageNames()) - if conf.DB.ToPQString(true) == "" { + dsn := glsql.DSN(conf.DB, true) + if dsn == "" { csg = rs logger.Info("reads distribution caching is disabled because direct connection to Postgres is not set") } else { listenerOpts := datastore.DefaultPostgresListenerOpts - listenerOpts.Addr = conf.DB.ToPQString(true) + listenerOpts.Addr = dsn listenerOpts.Channels = []string{"repositories_updates", "storage_repositories_updates"} storagesCached, err := datastore.NewCachingConsistentStoragesGetter(logger, rs, conf.VirtualStorageNames()) |