mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Back out matrix-org/dendrite#2421 by restoring http.Client
s
This creates problems with non-HTTPS endpoints and should fix #2444.
This commit is contained in:
parent
1b3fa9689c
commit
77722c5a4f
6 changed files with 44 additions and 33 deletions
|
@ -39,7 +39,7 @@ type phoneHomeStats struct {
|
|||
cfg *config.Dendrite
|
||||
db storage.Statistics
|
||||
isMonolith bool
|
||||
client *gomatrixserverlib.Client
|
||||
client *http.Client
|
||||
}
|
||||
|
||||
type timestampToRUUsage struct {
|
||||
|
@ -55,9 +55,10 @@ func StartPhoneHomeCollector(startTime time.Time, cfg *config.Dendrite, statsDB
|
|||
cfg: cfg,
|
||||
db: statsDB,
|
||||
isMonolith: cfg.IsMonolith,
|
||||
client: gomatrixserverlib.NewClient(
|
||||
gomatrixserverlib.WithTimeout(time.Second * 30),
|
||||
),
|
||||
client: &http.Client{
|
||||
Timeout: time.Second * 30,
|
||||
Transport: http.DefaultTransport,
|
||||
},
|
||||
}
|
||||
|
||||
// start initial run after 5min
|
||||
|
@ -151,7 +152,8 @@ func (p *phoneHomeStats) collect() {
|
|||
}
|
||||
request.Header.Set("User-Agent", "Dendrite/"+internal.VersionString())
|
||||
|
||||
if _, err = p.client.DoHTTPRequest(ctx, request); err != nil {
|
||||
_, err = p.client.Do(request)
|
||||
if err != nil {
|
||||
logrus.WithError(err).Error("unable to send anonymous stats")
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue