fix_: ctx not available when starting telemetry client (#5368)
This commit is contained in:
parent
e9882e88d3
commit
83955bbc8a
|
@ -427,15 +427,6 @@ func NewMessenger(
|
||||||
anonMetricsServer.Logger = logger
|
anonMetricsServer.Logger = logger
|
||||||
}
|
}
|
||||||
|
|
||||||
var telemetryClient *telemetry.Client
|
|
||||||
if c.telemetryServerURL != "" {
|
|
||||||
telemetryClient = telemetry.NewClient(logger, c.telemetryServerURL, c.account.KeyUID, nodeName, version)
|
|
||||||
if c.wakuService != nil {
|
|
||||||
c.wakuService.SetStatusTelemetryClient(telemetryClient)
|
|
||||||
}
|
|
||||||
go telemetryClient.Start(messenger.ctx)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize push notification server
|
// Initialize push notification server
|
||||||
var pushNotificationServer *pushnotificationserver.Server
|
var pushNotificationServer *pushnotificationserver.Server
|
||||||
if c.pushNotificationServerConfig != nil && c.pushNotificationServerConfig.Enabled {
|
if c.pushNotificationServerConfig != nil && c.pushNotificationServerConfig.Enabled {
|
||||||
|
@ -532,6 +523,15 @@ func NewMessenger(
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
|
||||||
|
var telemetryClient *telemetry.Client
|
||||||
|
if c.telemetryServerURL != "" {
|
||||||
|
telemetryClient = telemetry.NewClient(logger, c.telemetryServerURL, c.account.KeyUID, nodeName, version)
|
||||||
|
if c.wakuService != nil {
|
||||||
|
c.wakuService.SetStatusTelemetryClient(telemetryClient)
|
||||||
|
}
|
||||||
|
go telemetryClient.Start(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
messenger = &Messenger{
|
messenger = &Messenger{
|
||||||
config: &c,
|
config: &c,
|
||||||
node: node,
|
node: node,
|
||||||
|
|
Loading…
Reference in New Issue