No need for an extra method to create a pushgateway client

This commit is contained in:
Till Faelligen 2023-03-16 09:58:40 +01:00
parent c06e253188
commit 3a2e8606c7
No known key found for this signature in database
GPG key ID: ACCDC9606D472758
2 changed files with 2 additions and 7 deletions

View file

@ -43,7 +43,6 @@ import (
"github.com/matrix-org/dendrite/internal"
"github.com/matrix-org/dendrite/internal/httputil"
"github.com/matrix-org/dendrite/internal/pushgateway"
"github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/gorilla/mux"
@ -232,11 +231,6 @@ func (b *BaseDendrite) DatabaseConnection(dbProperties *config.DatabaseOptions,
return nil, nil, fmt.Errorf("no database connections configured")
}
// PushGatewayHTTPClient returns a new client for interacting with (external) Push Gateways.
func (b *BaseDendrite) PushGatewayHTTPClient() pushgateway.Client {
return pushgateway.NewHTTPClient(b.Cfg.UserAPI.PushGatewayDisableTLSValidation)
}
// CreateClient creates a new client (normally used for media fetch requests).
// Should only be called once per component.
func (b *BaseDendrite) CreateClient() *gomatrixserverlib.Client {

View file

@ -18,6 +18,7 @@ import (
"time"
fedsenderapi "github.com/matrix-org/dendrite/federationapi/api"
"github.com/matrix-org/dendrite/internal/pushgateway"
"github.com/sirupsen/logrus"
rsapi "github.com/matrix-org/dendrite/roomserver/api"
@ -42,7 +43,7 @@ func NewInternalAPI(
js, _ := base.NATS.Prepare(base.ProcessContext, &cfg.Matrix.JetStream)
appServices := base.Cfg.Derived.ApplicationServices
pgClient := base.PushGatewayHTTPClient()
pgClient := pushgateway.NewHTTPClient(cfg.PushGatewayDisableTLSValidation)
db, err := storage.NewUserDatabase(
base,