mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
fix(GODT-2774): Add external context to telemetry tasks
This ensures they get cancelled if the parent context becomes invalid
This commit is contained in:
committed by
Romain LE JEUNE
parent
6579cdfc7f
commit
c4f80103b6
@ -18,6 +18,7 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"testing"
|
||||
"time"
|
||||
@ -54,14 +55,14 @@ func (hb *heartbeatRecorder) GetLastHeartbeatSent() time.Time {
|
||||
return hb.bridge.GetLastHeartbeatSent()
|
||||
}
|
||||
|
||||
func (hb *heartbeatRecorder) IsTelemetryAvailable() bool {
|
||||
func (hb *heartbeatRecorder) IsTelemetryAvailable(ctx context.Context) bool {
|
||||
if hb.bridge == nil {
|
||||
return false
|
||||
}
|
||||
return hb.bridge.IsTelemetryAvailable()
|
||||
return hb.bridge.IsTelemetryAvailable(ctx)
|
||||
}
|
||||
|
||||
func (hb *heartbeatRecorder) SendHeartbeat(metrics *telemetry.HeartbeatData) bool {
|
||||
func (hb *heartbeatRecorder) SendHeartbeat(_ context.Context, metrics *telemetry.HeartbeatData) bool {
|
||||
if hb.bridge == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user