-
Notifications
You must be signed in to change notification settings - Fork 894
fix: use authenticated urls for pubsub #14261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
b89ff23
88d50b8
8be0524
3be05c2
c7964e4
6ff2ec7
02258ee
9d8681b
85f6cfe
dae69c7
55df464
2019fec
ff2784c
c18963b
1600abf
839a52e
428f3f5
cd61cc7
c946cdd
1b139e4
8c96f6e
a645a76
ed009f7
c8a7c9a
05cbc3c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -441,15 +441,16 @@ func (p *PGPubsub) startListener(ctx context.Context, connectURL string) error { | |
|
||
// Create a custom connector if the database driver supports it. | ||
connectorCreator, ok := p.db.Driver().(database.ConnectorCreator) | ||
if !ok { | ||
connector, err = pq.NewConnector(connectURL) | ||
if ok { | ||
connector, err = connectorCreator.Connector(connectURL) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code doesn't get hit in the package unit tests. A good way to test it would be to create a pq Driver wrapper that we can control. I'd like to see a test where we start pubsub with the wrapped driver, do some pub'ing and sub'ing, then kill the connection and verify that the pubsub / pq.Listener reconnects automatically. That would give a nice test of the pq changes you made as well. |
||
if err != nil { | ||
return xerrors.Errorf("create pq connector: %w", err) | ||
return xerrors.Errorf("create custom connector: %w", err) | ||
} | ||
} else { | ||
connector, err = connectorCreator.Connector(connectURL) | ||
// use the default pq connector otherwise | ||
connector, err = pq.NewConnector(connectURL) | ||
if err != nil { | ||
return xerrors.Errorf("create custom connector: %w", err) | ||
return xerrors.Errorf("create pq connector: %w", err) | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍